lib/{nat,pmp}: Fix shadowing and nil IPs

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2979
This commit is contained in:
Audrius Butkevicius
2016-04-16 16:48:07 +00:00
committed by Jakob Borg
parent fa1cfd94d0
commit e61f424ade
2 changed files with 6 additions and 2 deletions

View File

@@ -27,6 +27,9 @@ func Discover(renewal, timeout time.Duration) []nat.Device {
l.Debugln("Failed to discover gateway", err)
return nil
}
if ip == nil || ip.IsUnspecified() {
return nil
}
l.Debugln("Discovered gateway at", ip)