Merge pull request #3800 from chiragshah6/evpn_dev

zebra: advertise evpn route upon l3vni svi mac chg
This commit is contained in:
Sri Mohana Singamsetty 2019-02-27 13:38:03 -08:00 committed by GitHub
commit 08252eceee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;