diff --git a/main.go b/main.go index 8fd3b5b..0c26f61 100644 --- a/main.go +++ b/main.go @@ -27,7 +27,7 @@ import ( ) // VERSION . -const VERSION = "0.6.7" +const VERSION = "0.6.8" func main() { // read configs diff --git a/proxy/direct.go b/proxy/direct.go index 8072cbf..38e11e4 100644 --- a/proxy/direct.go +++ b/proxy/direct.go @@ -55,6 +55,11 @@ func (d *Direct) Dial(network, addr string) (c net.Conn, err error) { } } + // no ip available (so no dials made), maybe the interface link is down + if c == nil && err == nil { + err = errors.New("dial failed, maybe the interface link is down, please check it") + } + return } @@ -113,9 +118,7 @@ func (d *Direct) IFaceIPs() (ips []net.IP) { } for _, ipnet := range ipnets { - if ip := ipnet.(*net.IPNet).IP; !ip.IsLinkLocalUnicast() { - ips = append(ips, ip) - } + ips = append(ips, ipnet.(*net.IPNet).IP) //!ip.IsLinkLocalUnicast() } return