diff options
author | Sri Mohana Singamsetty <srimohans@gmail.com> | 2019-02-27 22:38:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 22:38:03 +0100 |
commit | 08252eceeedf3e187d0f5e239f340aa861e51110 (patch) | |
tree | 065a94c955715365f99b3b51254f49e9645b651a /zebra | |
parent | Merge pull request #3885 from qlyoung/capabilty (diff) | |
parent | zebra: advertise evpn route upon l3vni svi mac chg (diff) | |
download | frr-08252eceeedf3e187d0f5e239f340aa861e51110.tar.xz frr-08252eceeedf3e187d0f5e239f340aa861e51110.zip |
Merge pull request #3800 from chiragshah6/evpn_dev
zebra: advertise evpn route upon l3vni svi mac chg
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/if_netlink.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index faca52fe4..3583d63d3 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -68,6 +68,7 @@ #include "zebra/kernel_netlink.h" #include "zebra/if_netlink.h" #include "zebra/zebra_errors.h" +#include "zebra/zebra_vxlan.h" extern struct zebra_privs_t zserv_privs; @@ -1111,6 +1112,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) ifindex_t bridge_ifindex = IFINDEX_INTERNAL; ifindex_t bond_ifindex = IFINDEX_INTERNAL; ifindex_t link_ifindex = IFINDEX_INTERNAL; + uint8_t old_hw_addr[INTERFACE_HWADDR_MAX]; zns = zebra_ns_lookup(ns_id); @@ -1312,6 +1314,8 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) was_bond_slave = IS_ZEBRA_IF_BOND_SLAVE(ifp); zebra_if_set_ziftype(ifp, zif_type, zif_slave_type); + memcpy(old_hw_addr, ifp->hw_addr, INTERFACE_HWADDR_MAX); + netlink_interface_update_hw_addr(tb, ifp); if (if_is_no_ptm_operative(ifp)) { @@ -1330,6 +1334,22 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) "Intf %s(%u) PTM up, notifying clients", name, ifp->ifindex); zebra_interface_up_update(ifp); + + /* Update EVPN VNI when SVI MAC change + */ + if (IS_ZEBRA_IF_VLAN(ifp) && + memcmp(old_hw_addr, ifp->hw_addr, + INTERFACE_HWADDR_MAX)) { + struct interface *link_if; + + link_if = + if_lookup_by_index_per_ns( + zebra_ns_lookup(NS_DEFAULT), + link_ifindex); + if (link_if) + zebra_vxlan_svi_up(ifp, + link_if); + } } } else { ifp->flags = ifi->ifi_flags & 0x0000fffff; |