Skip to content

Commit

Permalink
nhrpd: fix sending /32 shortcut
Browse files Browse the repository at this point in the history
The remote spoke always sends a 32 prefix length to a shortcut request.
In the example, the remote spoke as the IP address 192.168.2.1/24.

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.1/32           10.255.255.2

Do not deal with local routes in nhrpd. Now:

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.0/24           10.255.255.2

Fixes: d4aa24b ("*: Introduce Local Host Routes to FRR")
Signed-off-by: Louis Scalbert <[email protected]>
(cherry picked from commit af54901)
  • Loading branch information
louis-6wind authored and mergify[bot] committed Aug 23, 2024
1 parent a23ef65 commit eb10a87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nhrpd/nhrp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ int nhrp_route_read(ZAPI_CALLBACK_ARGS)
if (api.type == ZEBRA_ROUTE_NHRP)
return 0;

/* ignore local routes */
if (api.type == ZEBRA_ROUTE_LOCAL)
return 0;

sockunion_family(&nexthop_addr) = AF_UNSPEC;
if (CHECK_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP)) {
api_nh = &api.nexthops[0];
Expand Down

0 comments on commit eb10a87

Please sign in to comment.