Fix autosense not working

This commit is contained in:
Kioubit 2021-12-28 06:44:49 -05:00
parent 2e62c0b5d5
commit 1ec9477d69

View File

@ -117,6 +117,7 @@ func respond(iface string, requests chan *ndpRequest, respondType ndpType, ndpQu
continue
}
// Auto-sense
if autoSense != "" {
autoiface, err := net.InterfaceByName(autoSense)
if err != nil {
@ -125,11 +126,11 @@ func respond(iface string, requests chan *ndpRequest, respondType ndpType, ndpQu
autoifaceaddrs, err := autoiface.Addrs()
for _, l := range autoifaceaddrs {
_, anet, err := net.ParseCIDR(l.String())
testIP, anet, err := net.ParseCIDR(l.String())
if err != nil {
break
}
if isIpv6(anet.String()) {
if isIpv6(testIP.String()) {
filter = append(filter, anet)
}
}