Skip to content
Permalink
Browse files

zebra: mark router flag for neigh update

The neigh update can come prior to mac add update.
In this case, the mac will be auto created for the vni.
set router flag to local neigh update for mac with auto flag.

The neigh update will be informed to bgpd once local mac is learnt.

Unset router flag if the neigh update comes without the router flag
for an existing neigh entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
  • Loading branch information...
chiragshah6 committed Aug 14, 2018
1 parent 0a4ecf2 commit 54c174250c381580b0477e6eade2c03c4109ed64
Showing with 8 additions and 5 deletions.
  1. +8 −5 zebra/zebra_vxlan.c
@@ -2060,6 +2060,12 @@ static int zvni_local_neigh_update(zebra_vni_t *zvni,
n->ifindex = ifp->ifindex;
}

/*Mark Router flag (R-bit) */
if (router_flag)
SET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);
else
UNSET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);

/* Before we program this in BGP, we need to check if MAC is locally
* learnt as well
*/
@@ -2074,10 +2080,6 @@ static int zvni_local_neigh_update(zebra_vni_t *zvni,
return 0;
}

/*Set router flag (R-bit) */
if (router_flag)
SET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);

/* Inform BGP. */
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("Neigh %s (MAC %s) is now ACTIVE on L2-VNI %u with flags 0x%x",
@@ -4965,10 +4967,11 @@ int zebra_vxlan_handle_kernel_neigh_update(struct interface *ifp,

if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
"Add/Update neighbor %s MAC %s intf %s(%u) state 0x%x %s-> L2-VNI %u",
"Add/Update neighbor %s MAC %s intf %s(%u) state 0x%x %s %s-> L2-VNI %u",
ipaddr2str(ip, buf2, sizeof(buf2)),
prefix_mac2str(macaddr, buf, sizeof(buf)), ifp->name,
ifp->ifindex, state, ext_learned ? "ext-learned " : "",
router_flag ? "router " : "",
zvni->vni);

/* Is this about a local neighbor or a remote one? */

0 comments on commit 54c1742

Please sign in to comment.
You can’t perform that action at this time.