diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index e4140393487d..e3465feda861 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -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);