diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2025-04-08 22:12:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-08 22:12:02 -0500 |
| commit | 42cc81f57d3d7d2f0bdc4d776d8fe0b985990e39 (patch) | |
| tree | 4b12f110941ee3c38bc69a25088fc07c6b08570d | |
| parent | c71660bf0d39bf48ede9783d5012ef9eacbb4980 (diff) | |
| parent | 06bd33495dfd77e5d4506a8aeb3303b2e6ef392b (diff) | |
Merge pull request #18616 from FRRouting/mergify/bp/stable/10.3/pr-18598
nhrpd: Add Hop Count Validation Before Forwarding in nhrp_peer_recv() (backport #18598)
| -rw-r--r-- | nhrpd/nhrp_peer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c index fa11980c18..97932795a3 100644 --- a/nhrpd/nhrp_peer.c +++ b/nhrpd/nhrp_peer.c @@ -1355,6 +1355,11 @@ void nhrp_peer_recv(struct nhrp_peer *p, struct zbuf *zb) } break; case NHRP_ROUTE_NBMA_NEXTHOP: + if (hdr->hop_count == 0) { + nhrp_packet_send_error(&pp, NHRP_ERROR_HOP_COUNT_EXCEEDED, 0); + info = "hop count exceeded"; + goto drop; + } nhrp_peer_forward(peer, &pp); break; case NHRP_ROUTE_BLACKHOLE: |
