mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
internal/clientinfo: skipping non-reachable neighbor
Otherwise, failed or stale ipv6 will be used if it appeared last in the table, instaed of the current one.
This commit is contained in:
committed by
Cuong Manh Le
parent
20f8f22bae
commit
5ba90748f6
@@ -15,9 +15,12 @@ func (nd *ndpDiscover) scan() {
|
||||
}
|
||||
|
||||
for _, n := range neighs {
|
||||
// Skipping non-reachable neighbors.
|
||||
if n.State&netlink.NUD_REACHABLE == 0 {
|
||||
continue
|
||||
}
|
||||
ip := n.IP.String()
|
||||
mac := n.HardwareAddr.String()
|
||||
nd.saveInfo(ip, mac)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user