]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: refresh vxlan evpn contexts, when bridge interface goes up
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 17 Aug 2021 08:56:32 +0000 (10:56 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 17 Sep 2021 08:25:38 +0000 (10:25 +0200)
When using bgp evpn rt5 setup, after BGP configuration has been
loaded, if the user attempts to detach and reattach the bridged
vxlan interface from the bridge, then BGP loses its BGP EVPN
contexts, and a refresh of BGP configuration is necessary to
maintain consistency between linux configuration and BGP EVPN
contexts (RIB). The following command can lead to inconsistency:

ip netns exec cust1 ip link set dev vxlan1000 nomaster
ip netns exec cust1 ip link set dev vxlan1000 master br1000

consecutive to the, BGP l2vpn evpn RIB is empty, and the way to
solve this until now is to reconfigure EVPN like this:

vrf cust1
 no vni 1000
 vni 1000
exit-vrf

Actually, the link information is correctly handled. In fact,
at the time of link event, the lower link status of the bridge
interface was not yet up, thus preventing from establishing
BGP EVPN contexts. In fact, when a bridge interface does not
have any slave interface, the link status of the bridge interface
is down. That change of status comes a bit after, and is not
detected by slave interfaces, as this event is not intercepted.

This commit intercepts the bridge link up event, and triggers
a check on slaved vxlan interfaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
zebra/if_netlink.c
zebra/zebra_l2.c
zebra/zebra_l2.h

index 658b862e62883bf1c8b6e1714de174d6a8e1cfe8..a78b7607a00a57ee9c1567f5d1e473490083a22b 100644 (file)
@@ -1756,6 +1756,9 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
                                                        "Intf %s(%u) has come UP",
                                                        name, ifp->ifindex);
                                        if_up(ifp);
+                                       if (IS_ZEBRA_IF_BRIDGE(ifp))
+                                               chgflags =
+                                                       ZEBRA_BRIDGE_MASTER_UP;
                                } else {
                                        if (IS_ZEBRA_DEBUG_KERNEL)
                                                zlog_debug(
index ae630314be1ebcdb2c60e56f7ba667b5c7e01c25..5a02149611fbaf8e8d27694ae8f28b439ac0140e 100644 (file)
@@ -434,6 +434,8 @@ void zebra_l2if_update_bridge_slave(struct interface *ifp,
                if (ZEBRA_BRIDGE_MASTER_MAC_CHANGE)
                        zebra_vxlan_if_update(ifp,
                                              ZEBRA_VXLIF_MASTER_MAC_CHANGE);
+               if (ZEBRA_BRIDGE_MASTER_UP)
+                       zebra_vxlan_if_update(ifp, ZEBRA_VXLIF_MASTER_CHANGE);
        }
        old_bridge_ifindex = zif->brslave_info.bridge_ifindex;
        old_ns_id = zif->brslave_info.ns_id;
index de833ebdbc684134466f78b01775718e32da1085..98744f3c1fbf390598d5c14eb7f977bed1abb7ad 100644 (file)
@@ -35,6 +35,7 @@ extern "C" {
 
 #define ZEBRA_BRIDGE_NO_ACTION (0)
 #define ZEBRA_BRIDGE_MASTER_MAC_CHANGE (1 << 1)
+#define ZEBRA_BRIDGE_MASTER_UP (1 << 2)
 
 /* zebra L2 interface information - bridge slave (linkage to bridge) */
 struct zebra_l2info_brslave {