]> git.puffer.fish Git - mirror/frr.git/commitdiff
nhrpd: fix dont consider incomplete L2 entry 18113/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 10 Feb 2025 15:15:44 +0000 (16:15 +0100)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Wed, 12 Feb 2025 02:58:19 +0000 (02:58 +0000)
Sometimes, NHRP receives L2 information on a cache entry with the
0.0.0.0 IP address. NHRP considers it as valid and updates the binding
with the new IP address.

> Feb 09 20:09:54 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x2 cache used 0 type 4
> Feb 09 20:10:35 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x4 cache used 1 type 4
> Feb 09 20:10:48 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: del-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x4 cache used 1 type 4
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: who-has 10.2.114.238 dev dmvpn1 lladdr (unspec) nud 0x1 cache used 1 type 4
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QVXNM-NVHEQ] Netlink: update binding for 10.2.114.238 dev dmvpn1 from c 162.251.180.10 peer.vc.nbma 162.251.180.10 to lladdr (unspec)
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 0.0.0.0 nud 0x2 cache used 1 type 4
> Feb 09 20:11:30 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 0.0.0.0 nud 0x4 cache used 1 type 4

Actually, the 0.0.0.0 IP addressed mentiones in the 'who-has' message is
wrong because the nud state value means that value is incomplete and
should not be handled as a valid entry. Instead of considering it, fix
this by by invalidating the current binding. This step is necessary in
order to permit NHRP to trigger resolution requests again.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 3202323052485d8138a3440e9c9907594ad99c57)

nhrpd/netlink_arp.c

index be909c862ae03ec0c1f0d5fc8313c5d6bf376ba2..564e04deba6cbd64a6bf6e79c43f5ce11a8eced3 100644 (file)
@@ -184,7 +184,7 @@ int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS)
               : (cmd == ZEBRA_NEIGH_ADDED) ? "new-neigh"
                                            : "del-neigh",
               &addr, ifp->name, &lladdr, ndm_state, c->used, c->cur.type);
-       if (cmd == ZEBRA_NEIGH_GET) {
+       if (cmd == ZEBRA_NEIGH_GET && ndm_state != ZEBRA_NEIGH_STATE_INCOMPLETE) {
                if (c->cur.type >= NHRP_CACHE_CACHED) {
                        nhrp_cache_set_used(c, 1);
                        debugf(NHRP_DEBUG_KERNEL,