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 Mar 11, 2024
1 parent 4378451 commit c2edcce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nhrpd/netlink_arp.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS)
}
} else {
state = (cmd == ZEBRA_NEIGH_ADDED) ? ndm_state
: ZEBRA_NEIGH_STATE_FAILED;
nhrp_cache_set_used(c, state == ZEBRA_NEIGH_STATE_REACHABLE);
: ZEBRA_NEIGH_STATE_FAILED;
if (ndm_state != ZEBRA_NEIGH_STATE_STALE)
nhrp_cache_set_used(c,
state == ZEBRA_NEIGH_STATE_REACHABLE);
}
return 0;
}

0 comments on commit c2edcce

Please sign in to comment.