summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2020-08-07 18:32:52 -0700
committerAnuradha Karuppiah <anuradhak@nvidia.com>2020-12-21 08:41:17 -0800
commit7c0e4dc6595ea0486eead82f951e8cd54d6ea24c (patch)
tree70e8fc6020288fba149c69147388bf12e6f65c43 /zebra/rt_netlink.c
parentb37ff319f3458e2ba416b52193ccced683c1dec8 (diff)
zebra: reinstall missing peer-sync flag
If a netlink/dp notification is rxed for a neigh without the peer-sync flag FRR re-installs the entry with the right flags. This change is needed to handle cases where the dataplane and FRR may fall out of sync because of neigh learning on the network ports (i.e. via the VxLAN). Ticket: CM-30693 The problem was found during VM mobility "torture" tests where 100s of extended VM moves were done. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 42bb5974f8..ed9d007c4c 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -3300,6 +3300,8 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
bool is_ext;
bool is_router;
bool local_inactive;
+ uint32_t ext_flags = 0;
+ bool dp_static = false;
ndm = NLMSG_DATA(h);
@@ -3391,9 +3393,15 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
is_ext = !!(ndm->ndm_flags & NTF_EXT_LEARNED);
is_router = !!(ndm->ndm_flags & NTF_ROUTER);
+ if (tb[NDA_EXT_FLAGS]) {
+ ext_flags = *(uint32_t *)RTA_DATA(tb[NDA_EXT_FLAGS]);
+ if (ext_flags & NTF_E_MH_PEER_SYNC)
+ dp_static = true;
+ }
+
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug(
- "Rx %s family %s IF %s(%u) vrf %s(%u) IP %s MAC %s state 0x%x flags 0x%x",
+ "Rx %s family %s IF %s(%u) vrf %s(%u) IP %s MAC %s state 0x%x flags 0x%x ext_flags 0x%x",
nl_msg_type_to_str(h->nlmsg_type),
nl_family_to_str(ndm->ndm_family), ifp->name,
ndm->ndm_ifindex, VRF_LOGNAME(vrf), ifp->vrf_id,
@@ -3401,7 +3409,7 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
mac_present
? prefix_mac2str(&mac, buf, sizeof(buf))
: "",
- ndm->ndm_state, ndm->ndm_flags);
+ ndm->ndm_state, ndm->ndm_flags, ext_flags);
/* If the neighbor state is valid for use, process as an add or
* update
@@ -3420,13 +3428,9 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
*/
local_inactive = false;
- /* XXX - populate dp-static based on the sync flags
- * in the kernel
- */
return zebra_vxlan_handle_kernel_neigh_update(
- ifp, link_if, &ip, &mac, ndm->ndm_state,
- is_ext, is_router, local_inactive,
- false /* dp_static */);
+ ifp, link_if, &ip, &mac, ndm->ndm_state, is_ext,
+ is_router, local_inactive, dp_static);
}
return zebra_vxlan_handle_kernel_neigh_del(ifp, link_if, &ip);