1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-08 05:47:07 +09:00

localdiscovery fixes:

replace zeroconf with fork; sort interfaces; disable ipv6, tollerate long zeroconf shutodown
This commit is contained in:
Roman Khafizianov 2023-04-25 18:17:59 +02:00 committed by Mikhail Iudin
parent 9a0c0361a0
commit 54af31a2af
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
5 changed files with 186 additions and 98 deletions

View file

@ -3,7 +3,11 @@
package addrs
import "net"
import (
"net"
"github.com/anytypeio/go-anytype-middleware/util/slice"
)
func SetInterfaceAddrsGetter(getter InterfaceAddrsGetter) {}
@ -28,5 +32,9 @@ func GetInterfacesAddrs() (iAddrs InterfacesAddrs, err error) {
return
}
iAddrs.Interfaces = ifaces
iAddrs.Interfaces = slice.Filter(iAddrs.Interfaces, func(iface net.Interface) bool {
return iface.Flags&net.FlagUp != 0 && iface.Flags&net.FlagMulticast != 0
})
return
}