]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: handle all afi safi while bgp clear soft 3932/head
authorNitin Soni <nsoni@cumulusnetworks.com>
Tue, 12 Mar 2019 05:57:51 +0000 (22:57 -0700)
committerNitin Soni <nsoni@cumulusnetworks.com>
Tue, 26 Mar 2019 16:34:29 +0000 (09:34 -0700)
Currently, as part of bgp clear soft inboud and outbound we don't handle
l2vpn evpn. Now clearing soft for all supported afi safi.
One of the examples where this was a problem -

On applying graceful-shutdown, bgp clear soft inboud and outbound don't
handle AFI L2VPN and SAFI EVPN. Gshut gets applied to EVPN Type 5 routes
by asking peer to refresh the routes (provided we have config - "advertise
ipv4/ipv6 unicast" as part of l2vpn evpn) but is not applied to type 2
and type 3 EVP routes. This fix takes care of l2vpn evpn type2 and type3
routes being readvertised with gshut community.

This fix also fixes similar issues related to following where bgp clear
soft is requred for l2vpn evpn -
-config bgp cluster-id
-config bgp client-to-client reflection
-config bgp default local-preference
-config bgp route-reflector allow-outbound-policy
-config bgp disable-ebgp-connected-route-check

Ticket: CM-22813
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8361
Testing-Done:
-With gshut configured on all BGP VRFs (operator has to know about the
auto-created BGP VRFs - we do show them in show commands - and turn on
graceful-shutdown in all of them.
-We announce all EVPN routes (type-2, type-3 and type-5) with GSHUT and
we mark IPv4/IPv6 routes in a VRF that are based on received EVPN type-2
or type-5 routes with local pref 0.
-On the receiver side, when EVPN routes are received with GSHUT, the
correct handling takes place (to treat them with local preference 0, and
hence not select them)
-When the gshut configuration is removed on all BGP VRFs, we re-announce
all of our EVPN routes without GSHUT and receiver does the appropriate
thing. Also, we no longer mark EVPN-based IPv4/IPv6 routes with local
pref 0.
-evpn-smoke
-bgp-smoke

bgpd/bgp_vty.c

index b059ef2205b548ad14874225da29f6a30dc7f051..1d5cae55c219deed80960e121e57efbb8f9fbc81 100644 (file)
@@ -771,19 +771,23 @@ static int bgp_clear_vty(struct vty *vty, const char *name, afi_t afi,
 /* clear soft inbound */
 static void bgp_clear_star_soft_in(struct vty *vty, const char *name)
 {
-       bgp_clear_vty(vty, name, AFI_IP, SAFI_UNICAST, clear_all,
-                     BGP_CLEAR_SOFT_IN, NULL);
-       bgp_clear_vty(vty, name, AFI_IP6, SAFI_UNICAST, clear_all,
-                     BGP_CLEAR_SOFT_IN, NULL);
+       afi_t afi;
+       safi_t safi;
+
+       FOREACH_AFI_SAFI (afi, safi)
+               bgp_clear_vty(vty, name, afi, safi, clear_all,
+                             BGP_CLEAR_SOFT_IN, NULL);
 }
 
 /* clear soft outbound */
 static void bgp_clear_star_soft_out(struct vty *vty, const char *name)
 {
-       bgp_clear_vty(vty, name, AFI_IP, SAFI_UNICAST, clear_all,
-                     BGP_CLEAR_SOFT_OUT, NULL);
-       bgp_clear_vty(vty, name, AFI_IP6, SAFI_UNICAST, clear_all,
-                     BGP_CLEAR_SOFT_OUT, NULL);
+       afi_t afi;
+       safi_t safi;
+
+       FOREACH_AFI_SAFI (afi, safi)
+               bgp_clear_vty(vty, name, afi, safi, clear_all,
+                             BGP_CLEAR_SOFT_OUT, NULL);
 }