diff options
| author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2025-04-08 14:28:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-08 14:28:42 -0500 |
| commit | 9e974a6d16f5405e44d21c52a4ad97fb6aa8343a (patch) | |
| tree | 98f0c66ba1976fdb7c557382c25d03e39e5d2f3f | |
| parent | 4b81bbbac3619980b0d0a04cce8e1aa96c6b878c (diff) | |
| parent | 623b3ab5c8f521b336bf6405c69d0a40cc743163 (diff) | |
Merge pull request #18615 from FRRouting/mergify/bp/stable/10.2/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: |
