Skip to content

Commit

Permalink
bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric value
Browse files Browse the repository at this point in the history
Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Dec 17, 2023
1 parent a912f8f commit 66c78c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bgpd/bgp_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,15 @@ 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",
hdr->length);
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);
Expand Down

0 comments on commit 66c78c6

Please sign in to comment.