From: Donatas Abraitis Date: Sun, 17 Dec 2023 10:03:36 +0000 (+0200) Subject: bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric value X-Git-Tag: base_10.0~180^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=66c78c6c58539a4ed5132adbc5a5b1d86194b90c;p=mirror%2Ffrr.git bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric value Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 44cf8343c6..4180c7d345 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -665,7 +665,7 @@ static int bgp_capability_addpath(struct peer *peer, SET_FLAG(peer->cap, PEER_CAP_ADDPATH_RCV); /* Verify length is a multiple of 4 */ - if (hdr->length % 4) { + if (hdr->length % CAPABILITY_CODE_ADDPATH_LEN) { flog_warn( EC_BGP_CAPABILITY_INVALID_LENGTH, "Add Path: Received invalid length %d, non-multiple of 4", @@ -673,7 +673,7 @@ static int bgp_capability_addpath(struct peer *peer, return -1; } - while (stream_get_getp(s) + 4 <= end) { + while (stream_get_getp(s) + CAPABILITY_CODE_ADDPATH_LEN <= end) { afi_t afi; safi_t safi; iana_afi_t pkt_afi = stream_getw(s);