]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_attr.c
Merge pull request #3370 from pguibert6WIND/default_vrf_initialization
[mirror_frr.git] / bgpd / bgp_attr.c
index e183073eca5ae1eebd4f62bdb5fc8f26a7436e4c..87ebb9c285f91eaf214fe3314d7048d2071019e3 100644 (file)
@@ -849,7 +849,7 @@ void bgp_attr_undup(struct attr *new, struct attr *old)
                aspath_free(new->aspath);
 
        if (new->community != old->community)
-               community_free(new->community);
+               community_free(&new->community);
 
        if (new->ecommunity != old->ecommunity)
                ecommunity_free(&new->ecommunity);
@@ -887,11 +887,8 @@ void bgp_attr_flush(struct attr *attr)
                aspath_free(attr->aspath);
                attr->aspath = NULL;
        }
-       if (attr->community && !attr->community->refcnt) {
-               community_free(attr->community);
-               attr->community = NULL;
-       }
-
+       if (attr->community && !attr->community->refcnt)
+               community_free(&attr->community);
        if (attr->ecommunity && !attr->ecommunity->refcnt)
                ecommunity_free(&attr->ecommunity);
        if (attr->lcommunity && !attr->lcommunity->refcnt)
@@ -1700,7 +1697,7 @@ int bgp_mp_reach_parse(struct bgp_attr_parser_args *args,
                                 * - for consistency in rx processing
                                 *
                                 * The following comment is to signal GCC this intention
-                                * and supress the warning
+                                * and suppress the warning
                                 */
        /* FALLTHRU */
        case BGP_ATTR_NHLEN_IPV4:
@@ -2627,7 +2624,7 @@ bgp_attr_parse_ret_t bgp_attr_parse(struct peer *peer, struct attr *attr,
                        return ret;
                }
 
-               /* If hard error occured immediately return to the caller. */
+               /* If hard error occurred immediately return to the caller. */
                if (ret == BGP_ATTR_PARSE_ERROR) {
                        flog_warn(EC_BGP_ATTRIBUTE_PARSE_ERROR,
                                  "%s: Attribute %s, parse error", peer->host,
@@ -3498,8 +3495,8 @@ void bgp_packet_mpunreach_prefix(struct stream *s, struct prefix *p, afi_t afi,
                num_labels = 1;
        }
 
-       return bgp_packet_mpattr_prefix(s, afi, safi, p, prd, label, num_labels,
-                                       addpath_encode, addpath_tx_id, attr);
+       bgp_packet_mpattr_prefix(s, afi, safi, p, prd, label, num_labels,
+                                addpath_encode, addpath_tx_id, attr);
 }
 
 void bgp_packet_mpunreach_end(struct stream *s, size_t attrlen_pnt)