summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2019-02-14 03:22:14 +0100
committerChirag Shah <chirag@cumulusnetworks.com>2019-02-21 22:50:43 +0100
commit97c4e1d0e47ade1da3c00c6cda93744444a23ae1 (patch)
tree85f43672ee82bc0cb5a9bf8ef1f7c71fdf782da3 /zebra
parentMerge pull request #3841 from donaldsharp/pim_test (diff)
downloadfrr-97c4e1d0e47ade1da3c00c6cda93744444a23ae1.tar.xz
frr-97c4e1d0e47ade1da3c00c6cda93744444a23ae1.zip
zebra: advertise evpn route upon l3vni svi mac chg
L3VNI keeps reference to svi interface (ifp). When a netlink change received there is no flag that mac has changed. Currently simply overwrite interface's (ifp) hw_addr (MAC) field. For originating EVPN type-2 and type-5 routes due to VNI MAC change, comparison is required to check existing MAC vs. netlink change MAC field. Ticket:CM-23850 Reviewed By:CCR-8283 Testing Done: Validate EVPN type-5 routes originated upon changing MAC address of L3VNI's SVI inteface via ip link set cmd. checked show bgp l2vpn evpn route and Rmac field contains new MAC address. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/if_netlink.c20
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;