]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_attr.c
Merge pull request #10356 from opensourcerouting/pim6-adjust-20220117
[mirror_frr.git] / bgpd / bgp_attr.c
index 008998c8b4fd3c0fdc7d52cbe778b15949659013..21f92c353eeca571d63e154bff86ea60ab820498 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;
@@ -789,7 +779,6 @@ static void attrhash_init(void)
  */
 static void attr_vfree(void *attr)
 {
-       bgp_attr_extra_free(attr);
        XFREE(MTYPE_ATTR, attr);
 }
 
@@ -1097,8 +1086,7 @@ void bgp_attr_unintern_sub(struct attr *attr)
        struct lcommunity *lcomm = NULL;
 
        /* aspath refcount shoud be decrement. */
-       if (attr->aspath)
-               aspath_unintern(&attr->aspath);
+       aspath_unintern(&attr->aspath);
        UNSET_FLAG(attr->flag, ATTR_FLAG_BIT(BGP_ATTR_AS_PATH));
 
        if (attr->community)
@@ -1236,7 +1224,6 @@ void bgp_attr_flush(struct attr *attr)
                bgp_attr_set_vnc_subtlvs(attr, NULL);
        }
 #endif
-       bgp_attr_extra_free(attr);
 }
 
 /* Implement draft-scudder-idr-optional-transitive behaviour and
@@ -3506,14 +3493,12 @@ done:
         * we can chuck as4_aggregator and as4_path alltogether in order
         * to save memory
         */
-       if (as4_path) {
-               /*
-                * unintern - it is in the hash
-                * The flag that we got this is still there, but that
-                * does not do any trouble
-                */
-               aspath_unintern(&as4_path);
-       }
+       /*
+        * unintern - it is in the hash
+        * The flag that we got this is still there, but that
+        * does not do any trouble
+        */
+       aspath_unintern(&as4_path);
 
        transit = bgp_attr_get_transit(attr);
        if (ret != BGP_ATTR_PARSE_ERROR) {