mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-23 15:18:24 +00:00
Merge pull request #1826 from AudriusButkevicius/screwflags
Don't check interface flags on Windows
This commit is contained in:
commit
12f76b448c
@ -12,6 +12,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -110,7 +111,8 @@ func (d *Discoverer) startLocalIPv6Multicasts(localMCAddr string) {
|
|||||||
|
|
||||||
v6Intfs := 0
|
v6Intfs := 0
|
||||||
for _, intf := range intfs {
|
for _, intf := range intfs {
|
||||||
if intf.Flags&net.FlagUp == 0 || intf.Flags&net.FlagMulticast == 0 {
|
// Interface flags seem to always be 0 on Windows
|
||||||
|
if runtime.GOOS != "windows" && (intf.Flags&net.FlagUp == 0 || intf.Flags&net.FlagMulticast == 0) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -129,10 +130,8 @@ func Discover(timeout time.Duration) []IGD {
|
|||||||
|
|
||||||
wg := sync.NewWaitGroup()
|
wg := sync.NewWaitGroup()
|
||||||
for _, intf := range interfaces {
|
for _, intf := range interfaces {
|
||||||
if intf.Flags&net.FlagUp == 0 {
|
// Interface flags seem to always be 0 on Windows
|
||||||
continue
|
if runtime.GOOS != "windows" && (intf.Flags&net.FlagUp == 0 || intf.Flags&net.FlagMulticast == 0) {
|
||||||
}
|
|
||||||
if intf.Flags&net.FlagMulticast == 0 {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user