Skip to content

Commit

Permalink
Don't check interface flags on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AudriusButkevicius committed May 17, 2015
1 parent e4b57a9 commit f112ef3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion internal/discover/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"errors"
"io"
"net"
"runtime"
"strconv"
"time"

Expand Down Expand Up @@ -110,7 +111,8 @@ func (d *Discoverer) startLocalIPv6Multicasts(localMCAddr string) {

v6Intfs := 0
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
}

Expand Down
7 changes: 3 additions & 4 deletions internal/upnp/upnp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"net/http"
"net/url"
"regexp"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -129,10 +130,8 @@ func Discover(timeout time.Duration) []IGD {

wg := sync.NewWaitGroup()
for _, intf := range interfaces {
if intf.Flags&net.FlagUp == 0 {
continue
}
if 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
}

Expand Down

0 comments on commit f112ef3

Please sign in to comment.