Merge pull request #18598 from zmw12306/nhrp_nexthop

nhrpd: Add Hop Count Validation Before Forwarding in nhrp_peer_recv()
This commit is contained in:
Jafar Al-Gharaibeh 2025-04-08 11:28:57 -05:00 committed by GitHub
commit c7a45b1beb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: