direct: remove link-local ip from IFaceIPs func

This commit is contained in:
nadoo 2018-08-22 00:11:31 +08:00
parent 1d5ef167ec
commit 0d1c4c5a47
2 changed files with 5 additions and 1 deletions

View File

@ -131,6 +131,8 @@ glider v0.6.7 usage:
timeout value used in multiple dnsservers switch(seconds) (default 3) timeout value used in multiple dnsservers switch(seconds) (default 3)
-forward value -forward value
forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS] forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]
-interface string
source ip or source interface
-ipset string -ipset string
ipset name ipset name
-listen value -listen value

View File

@ -113,7 +113,9 @@ func (d *Direct) IFaceIPs() (ips []net.IP) {
} }
for _, ipnet := range ipnets { for _, ipnet := range ipnets {
ips = append(ips, ipnet.(*net.IPNet).IP) if ip := ipnet.(*net.IPNet).IP; !ip.IsLinkLocalUnicast() {
ips = append(ips, ip)
}
} }
return return