Return new copy of interfaces on each Interfaces() call

This commit is contained in:
Neil Alexander 2019-06-29 00:12:56 +01:00
parent 54f1804101
commit 27b3b9b49b
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 16 additions and 56 deletions

View file

@ -38,8 +38,8 @@ func (m *Multicast) multicastStarted() {
awdlGoroutineStarted = true
for {
C.StopAWDLBrowsing()
for _, intf := range m.GetInterfaces() {
if intf.Name == "awdl0" {
for intf := range m.Interfaces() {
if intf == "awdl0" {
m.log.Infoln("Multicast discovery is using AWDL discovery")
C.StartAWDLBrowsing()
break