]> git.puffer.fish Git - mirror/frr.git/commitdiff
Revert "bgpd: Move out ipv6_ecommunity struct from attr to attr_extra" 10540/head
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 9 Feb 2022 10:06:51 +0000 (13:06 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 10 Feb 2022 09:00:30 +0000 (12:00 +0300)
This reverts commit 2703b7db19cebad82772d5210132dab412b855c3.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_memory.c
bgpd/bgp_memory.h

index b7113757b517fa8c4b3c0be68bcb99cfe397d5fe..0b32ac913b1c7588c2314a7ba2e625ab2454c4d6 100644 (file)
@@ -95,16 +95,6 @@ static const struct message attr_flag_str[] = {
 
 static struct hash *cluster_hash;
 
-struct attr_extra *bgp_attr_extra_alloc(void)
-{
-       return XCALLOC(MTYPE_ATTR_EXTRA, sizeof(struct attr_extra));
-}
-
-void bgp_attr_extra_free(struct attr *attr)
-{
-       XFREE(MTYPE_ATTR_EXTRA, attr->extra);
-}
-
 static void *cluster_hash_alloc(void *p)
 {
        const struct cluster_list *val = (const struct cluster_list *)p;
@@ -788,7 +778,6 @@ static void attrhash_init(void)
  */
 static void attr_vfree(void *attr)
 {
-       bgp_attr_extra_free(attr);
        XFREE(MTYPE_ATTR, attr);
 }
 
@@ -1165,7 +1154,6 @@ void bgp_attr_unintern(struct attr **pattr)
        if (attr->refcnt == 0) {
                ret = hash_release(attrhash, attr);
                assert(ret != NULL);
-               bgp_attr_extra_free(attr);
                XFREE(MTYPE_ATTR, attr);
                *pattr = NULL;
        }
index f88af4f4324e57b578c9b635388ac52a7e6b6746..7a33ed3da536f39f6e6fa6fe3baae92f0644238b 100644 (file)
@@ -159,11 +159,6 @@ struct bgp_attr_srv6_l3vpn {
        uint8_t transposition_offset;
 };
 
-struct attr_extra {
-       /* Extended Communities attribute. */
-       struct ecommunity *ipv6_ecommunity;
-};
-
 /* BGP core attribute structure. */
 struct attr {
        /* AS Path structure */
@@ -204,8 +199,8 @@ struct attr {
        /* Extended Communities attribute. */
        struct ecommunity *ecommunity;
 
-       /* Extra attributes, non IPv4/IPv6 AFI related */
-       struct attr_extra *extra;
+       /* Extended Communities attribute. */
+       struct ecommunity *ipv6_ecommunity;
 
        /* Large Communities attribute. */
        struct lcommunity *lcommunity;
@@ -478,8 +473,6 @@ extern void bgp_packet_mpunreach_end(struct stream *s, size_t attrlen_pnt);
 
 extern bgp_attr_parse_ret_t bgp_attr_nexthop_valid(struct peer *peer,
                                                   struct attr *attr);
-extern struct attr_extra *bgp_attr_extra_alloc(void);
-extern void bgp_attr_extra_free(struct attr *attr);
 
 static inline int bgp_rmap_nhop_changed(uint32_t out_rmap_flags,
                                        uint32_t in_rmap_flags)
@@ -528,23 +521,13 @@ static inline void bgp_attr_set_ecommunity(struct attr *attr,
 static inline struct ecommunity *
 bgp_attr_get_ipv6_ecommunity(const struct attr *attr)
 {
-       if (attr->extra)
-               return attr->extra->ipv6_ecommunity;
-
-       return NULL;
+       return attr->ipv6_ecommunity;
 }
 
 static inline void bgp_attr_set_ipv6_ecommunity(struct attr *attr,
                                                struct ecommunity *ipv6_ecomm)
 {
-       if (!attr->extra) {
-               if (!ipv6_ecomm)
-                       return;
-
-               attr->extra = bgp_attr_extra_alloc();
-       }
-
-       attr->extra->ipv6_ecommunity = ipv6_ecomm;
+       attr->ipv6_ecommunity = ipv6_ecomm;
 }
 
 static inline struct transit *bgp_attr_get_transit(const struct attr *attr)
index 7fbadab69462ef1b8ede628575257c6db2c2425d..ffb1ec162b5d480f8b953e199a81aabdef20d1c2 100644 (file)
@@ -43,7 +43,6 @@ DEFINE_MTYPE(BGPD, BGP_UPDGRP, "BGP update group");
 DEFINE_MTYPE(BGPD, BGP_UPD_SUBGRP, "BGP update subgroup");
 DEFINE_MTYPE(BGPD, BGP_PACKET, "BGP packet");
 DEFINE_MTYPE(BGPD, ATTR, "BGP attribute");
-DEFINE_MTYPE(BGPD, ATTR_EXTRA, "BGP extra attribute");
 DEFINE_MTYPE(BGPD, AS_PATH, "BGP aspath");
 DEFINE_MTYPE(BGPD, AS_SEG, "BGP aspath seg");
 DEFINE_MTYPE(BGPD, AS_SEG_DATA, "BGP aspath segment data");
index ffab8a1bccc3b25da0e70bf4872e666fbce3cb9b..63e7b40ef786456dd7faf9182cbdd4e2e9b6437f 100644 (file)
@@ -39,7 +39,6 @@ DECLARE_MTYPE(BGP_UPDGRP);
 DECLARE_MTYPE(BGP_UPD_SUBGRP);
 DECLARE_MTYPE(BGP_PACKET);
 DECLARE_MTYPE(ATTR);
-DECLARE_MTYPE(ATTR_EXTRA);
 DECLARE_MTYPE(AS_PATH);
 DECLARE_MTYPE(AS_SEG);
 DECLARE_MTYPE(AS_SEG_DATA);