mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-18 11:05:14 +00:00
lib/beacon: Check FlagRunning (#9051)
This commit is contained in:
parent
acd767b30b
commit
3147285c60
@ -52,7 +52,7 @@ func writeBroadcasts(ctx context.Context, inbox <-chan []byte, port int) error {
|
|||||||
|
|
||||||
var dsts []net.IP
|
var dsts []net.IP
|
||||||
for _, intf := range intfs {
|
for _, intf := range intfs {
|
||||||
if intf.Flags&net.FlagBroadcast == 0 {
|
if intf.Flags&net.FlagRunning == 0 || intf.Flags&net.FlagBroadcast == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ func writeMulticasts(ctx context.Context, inbox <-chan []byte, addr string) erro
|
|||||||
|
|
||||||
success := 0
|
success := 0
|
||||||
for _, intf := range intfs {
|
for _, intf := range intfs {
|
||||||
if intf.Flags&net.FlagMulticast == 0 {
|
if intf.Flags&net.FlagRunning == 0 || intf.Flags&net.FlagMulticast == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,6 @@ func Discover(ctx context.Context, _, timeout time.Duration) []nat.Device {
|
|||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
|
|
||||||
for _, intf := range interfaces {
|
for _, intf := range interfaces {
|
||||||
// Interface flags seem to always be 0 on Windows
|
|
||||||
if intf.Flags&net.FlagRunning == 0 || intf.Flags&net.FlagMulticast == 0 {
|
if intf.Flags&net.FlagRunning == 0 || intf.Flags&net.FlagMulticast == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user