Skip to content

Commit

Permalink
Merge pull request #17706 from cscarpitta/fix/convert-to-ipv6-max-byt…
Browse files Browse the repository at this point in the history
…elen

bgpd: Convert 16 to IPV6_MAX_BYTELEN
  • Loading branch information
Jafaral authored Dec 22, 2024
2 parents 79be632 + cfab26b commit 0fbda45
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,10 @@ static int bgp_interface_address_delete(ZAPI_CALLBACK_ARGS)
if (addr->family == AF_INET)
continue;

if (!IN6_IS_ADDR_LINKLOCAL(&addr->u.prefix6)
&& memcmp(&peer->nexthop.v6_global,
&addr->u.prefix6, 16)
== 0) {
memset(&peer->nexthop.v6_global, 0, 16);
if (!IN6_IS_ADDR_LINKLOCAL(&addr->u.prefix6) &&
memcmp(&peer->nexthop.v6_global, &addr->u.prefix6, IPV6_MAX_BYTELEN) ==
0) {
memset(&peer->nexthop.v6_global, 0, IPV6_MAX_BYTELEN);
FOREACH_AFI_SAFI (afi, safi)
bgp_announce_route(peer, afi, safi,
true);
Expand Down

0 comments on commit 0fbda45

Please sign in to comment.