Skip to content
Permalink
Browse files

zebra: mark router flag for remote neigh update

Handle Remote Neigh entry state change from Router to Host.

Remote MAC-IP update may not continue EVPN NA Extended community,
Zebra need to accomodate if router_flag change for existing neigh
and install with or without Router Flag (R-bit).

Testing:
Have locally run MAC/IP (neigh entry) with R-bit set,
Checke on remote VTEP 'show bgp evpn route ...mac ip' and
'show evpn arp-cache ...' contians router flag.

Change host to remove R-bit, which locally learnt entry removes
Router flag. This results in remote vtep to remove R-bit from
neigh entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
  • Loading branch information...
chiragshah6 committed Aug 17, 2018
1 parent 29c2ce7 commit 7d08917b321f480c26a1a7f794906d65fff0fdfa
Showing with 7 additions and 1 deletion.
  1. +7 −1 zebra/zebra_vxlan.c
@@ -5173,7 +5173,8 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
char buf[ETHER_ADDR_STRLEN];
char buf1[INET6_ADDRSTRLEN];
uint8_t sticky = 0;
u_char remote_gw = 0;
uint8_t remote_gw = 0;
uint8_t router_flag = 0;
uint8_t flags = 0;
struct interface *ifp = NULL;
struct zebra_if *zif = NULL;
@@ -5216,6 +5217,7 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
STREAM_GETC(s, flags);
sticky = CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_STICKY);
remote_gw = CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_GW);
router_flag = CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_ROUTER_FLAG);
l++;

if (IS_ZEBRA_DEBUG_VXLAN)
@@ -5347,6 +5349,8 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
*/
n = zvni_neigh_lookup(zvni, &ip);
if (!n || !CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)
|| ((CHECK_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG) ? 1 : 0)
!= router_flag)
|| (memcmp(&n->emac, &macaddr, sizeof(macaddr)) != 0)
|| !IPV4_ADDR_SAME(&n->r_vtep_ip, &vtep_ip))
update_neigh = 1;
@@ -5387,6 +5391,8 @@ void zebra_vxlan_remote_macip_add(ZAPI_HANDLER_ARGS)
/* Set router flag (R-bit) to this Neighbor entry */
if (CHECK_FLAG(flags, ZEBRA_MACIP_TYPE_ROUTER_FLAG))
SET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);
else
UNSET_FLAG(n->flags, ZEBRA_NEIGH_ROUTER_FLAG);

/* Install the entry. */
zvni_neigh_install(zvni, n);

0 comments on commit 7d08917

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