]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Check for the extended community size before setting the flag
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 17 Oct 2024 08:27:43 +0000 (11:27 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 22 Oct 2024 06:01:04 +0000 (09:01 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_attr.h

index 9cdac10f926660c37e5ddf3872816d2638381424..c5532f400597ee4575c045e924c9a68c6f302d73 100644 (file)
@@ -515,7 +515,7 @@ static inline void bgp_attr_set_ecommunity(struct attr *attr,
 {
        attr->ecommunity = ecomm;
 
-       if (ecomm)
+       if (ecomm && ecomm->size)
                SET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
        else
                UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
@@ -566,7 +566,7 @@ static inline void bgp_attr_set_ipv6_ecommunity(struct attr *attr,
 {
        attr->ipv6_ecommunity = ipv6_ecomm;
 
-       if (ipv6_ecomm)
+       if (ipv6_ecomm && ipv6_ecomm->size)
                SET_FLAG(attr->flag,
                         ATTR_FLAG_BIT(BGP_ATTR_IPV6_EXT_COMMUNITIES));
        else