From: Donatas Abraitis Date: Sat, 8 Feb 2025 11:01:01 +0000 (+0200) Subject: bgpd: Do not check for capability length for Link-Local Next Hop capability X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d3741f84371a6fd6bbfacabc13ed7e1ff8160de9;p=mirror%2Ffrr.git bgpd: Do not check for capability length for Link-Local Next Hop capability Capability's length is 0 and this is not needed to check if it's multiplied by X or there is a minimum length for that. Fixes: db853cc97eafee8742cd391aaa2b5bc58a6751ae ("bgpd: Implement Link-Local Next Hop capability") Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index be04d87b74..e03239f014 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -1069,7 +1069,6 @@ static int bgp_capability_parse(struct peer *peer, size_t length, case CAPABILITY_CODE_ROLE: case CAPABILITY_CODE_SOFT_VERSION: case CAPABILITY_CODE_PATHS_LIMIT: - case CAPABILITY_CODE_LINK_LOCAL: /* Check length. */ if (caphdr.length < cap_minsizes[caphdr.code]) { zlog_info( diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 3e90d7881c..7e342dba26 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -3781,7 +3781,6 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt, case CAPABILITY_CODE_ROLE: case CAPABILITY_CODE_SOFT_VERSION: case CAPABILITY_CODE_PATHS_LIMIT: - case CAPABILITY_CODE_LINK_LOCAL: if (hdr->length < cap_minsizes[hdr->code]) { zlog_info("%pBP: %s Capability length error: got %u, expected at least %u", peer, capability, hdr->length,