]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Clean up peer status checking for a received nlri 1908/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Mar 2018 13:12:55 +0000 (09:12 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 16 Mar 2018 13:12:55 +0000 (09:12 -0400)
In bgp_update_receive the first thing we do is establish
that the peer->status is Established.  We then do a bunch
of work and call bgp_nlri_parse where we break out for
each address family.  Each AFI is then checking for
being peer->status is Established again.  There is no
point in checking this again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd/bgp_evpn.c
bgpd/bgp_label.c
bgpd/bgp_mplsvpn.c
bgpd/bgp_route.c

index 94d9cb465be9c5c3c9fa0ef11bd10e36c19b92f6..b3d6f388b9f92933f39ff935451bd6e4083fb8cb 100644 (file)
@@ -3754,13 +3754,6 @@ int bgp_nlri_parse_evpn(struct peer *peer, struct attr *attr,
        u_char rlen;
        struct prefix p;
 
-       /* Check peer status. */
-       if (peer->status != Established) {
-               zlog_err("%u:%s - EVPN update received in state %d",
-                        peer->bgp->vrf_id, peer->host, peer->status);
-               return -1;
-       }
-
        /* Start processing the NLRI - there may be multiple in the MP_REACH */
        pnt = packet->nlri;
        lim = pnt + packet->length;
index 38b39075be376b51aecdc46d1f61050b0274175e..546ed0ed6829818b5f3f55e6f8cadc1ac14b7b99 100644 (file)
@@ -212,10 +212,6 @@ int bgp_nlri_parse_label(struct peer *peer, struct attr *attr,
        mpls_label_t label = MPLS_INVALID_LABEL;
        u_char llen;
 
-       /* Check peer status. */
-       if (peer->status != Established)
-               return 0;
-
        pnt = packet->nlri;
        lim = pnt + packet->length;
        afi = packet->afi;
index d87f78a7830dae257675914d0a04229031de40ab..4081093dec9a2687e0f9468b4ab3d4bfce66ce5d 100644 (file)
@@ -109,10 +109,6 @@ int bgp_nlri_parse_vpn(struct peer *peer, struct attr *attr,
        int addpath_encoded;
        u_int32_t addpath_id;
 
-       /* Check peer status. */
-       if (peer->status != Established)
-               return 0;
-
        /* Make prefix_rd */
        prd.family = AF_UNSPEC;
        prd.prefixlen = 64;
index 032b33229cdec58b92a89b08990c064925f4a9b3..35732d1bf5bc842642008dd6ec192b0a3cf5b342 100644 (file)
@@ -4060,10 +4060,6 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
        int addpath_encoded;
        u_int32_t addpath_id;
 
-       /* Check peer status. */
-       if (peer->status != Established)
-               return 0;
-
        pnt = packet->nlri;
        lim = pnt + packet->length;
        afi = packet->afi;