From d3741f84371a6fd6bbfacabc13ed7e1ff8160de9 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Sat, 8 Feb 2025 13:01:01 +0200 Subject: [PATCH] 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 --- bgpd/bgp_open.c | 1 - bgpd/bgp_packet.c | 1 - 2 files changed, 2 deletions(-) diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index be04d87b7443..e03239f0146b 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 3e90d7881c55..7e342dba26ad 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,