]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: remove dead label code in bgp_update 15305/head
authorLouis Scalbert <louis.scalbert@6wind.com>
Mon, 5 Feb 2024 14:43:45 +0000 (15:43 +0100)
committerLouis Scalbert <louis.scalbert@6wind.com>
Tue, 6 Feb 2024 12:30:14 +0000 (13:30 +0100)
No need to init new_attr. It is not used until it is overridden.

> new_attr = *attr;

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd/bgp_route.c

index b8d6c660b759caf09d6d64afa68bd0872d897a82..46f7f9b22ffc81f6e132f1537c5f3aeda691fb56 100644 (file)
@@ -4185,7 +4185,7 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
        int aspath_loop_count = 0;
        struct bgp_dest *dest;
        struct bgp *bgp;
-       struct attr new_attr;
+       struct attr new_attr = {};
        struct attr *attr_new;
        struct bgp_path_info *pi;
        struct bgp_path_info *new = NULL;
@@ -4218,10 +4218,6 @@ void bgp_update(struct peer *peer, const struct prefix *p, uint32_t addpath_id,
        if (orig_safi == SAFI_LABELED_UNICAST)
                safi = SAFI_UNICAST;
 
-       memset(&new_attr, 0, sizeof(new_attr));
-       new_attr.label_index = BGP_INVALID_LABEL_INDEX;
-       new_attr.label = MPLS_INVALID_LABEL;
-
        bgp = peer->bgp;
        dest = bgp_afi_node_get(bgp->rib[afi][safi], afi, safi, p, prd);
        /* TODO: Check to see if we can get rid of "is_valid_label" */