diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -59,7 +59,7 @@ func getSourceAddr(af string, srcAddr string) (*net.IP, error) { return nil, err } for _, a := range addrs { - if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { + if ipnet, ok := a.(*net.IPNet); ok && !ipnet.IP.IsLoopback() && !ipnet.IP.IsLinkLocalUnicast() { if (ipnet.IP.To4() != nil && af == "ip4") || (ipnet.IP.To4() == nil && af == "ip6") { return &ipnet.IP, nil } @@ -602,7 +602,9 @@ func main() { } fmt.Fprintf(os.Stderr, "Starting fbtracert with %d probes per second/ttl, base src port %d and with the port span of %d\n", *probeRate, *baseSrcPort, *maxSrcPorts) - fmt.Fprintf(os.Stderr, "Use '-logtostderr=true' cmd line option to see GLOG output\n") + if flag.Lookup("logtostderr").Value.String() != "true" { + fmt.Fprintf(os.Stderr, "Use '-logtostderr=true' cmd line option to see GLOG output\n") + } // this will catch senders quitting - we have one sender per ttl senderDone := make([]chan struct{}, *maxTTL) |