Skip to content

Commit

Permalink
nhrpd: fix ignore neighbor stale message
Browse files Browse the repository at this point in the history
The 'used' field of NHRP cache entries goes to false every
time it receives a netlink STALE message. Consequently, the
cache entry appears as unused until the reception of a PROBE
message triggers the neighbor entry re-configuration that
changes the entry to REACHABLE.

> '# show ip nhrp cache' command before receiving STALE message.
> Iface    Type     Protocol                 NBMA                     Claimed NBMA             Flags  Identity
> gre1     nhs      11.255.255.1             10.125.0.1               10.125.0.1                UT     west
> # ip monitor neigh dev gre1
> 10.125.0.1 lladdr de:ed:02:05:3c:b5 STALE
>
> '# show ip nhrp cache' command after sending STALE message.
> Iface    Type     Protocol                 NBMA                     Claimed NBMA             Flags  Identity
> gre1     nhs      11.255.255.1             10.125.0.1               10.125.0.1                T     west

Fix this by ignoring the STALE state, and do not change the cache
entry 'used' flag.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed Nov 6, 2023
1 parent 8897698 commit 2485aeb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nhrpd/netlink_arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS)
} else {
state = (cmd == ZEBRA_NHRP_NEIGH_ADDED) ? ndm_state
: ZEBRA_NEIGH_STATE_FAILED;
nhrp_cache_set_used(c, state == ZEBRA_NEIGH_STATE_REACHABLE);
if (ndm_state != ZEBRA_NEIGH_STATE_STALE)
nhrp_cache_set_used(c,
state == ZEBRA_NEIGH_STATE_REACHABLE);
}
return 0;
}

0 comments on commit 2485aeb

Please sign in to comment.