]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: mark router flag for remote neigh update 2854/head
authorChirag Shah <chirag@cumulusnetworks.com>
Fri, 17 Aug 2018 20:38:06 +0000 (13:38 -0700)
committerChirag Shah <chirag@cumulusnetworks.com>
Wed, 22 Aug 2018 22:34:53 +0000 (15:34 -0700)
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>
zebra/zebra_vxlan.c

index 0b034fd3b5e85d68f72cca133d49fd6668d93b3a..f63879159d7ecd4d3cd616f2ee2ec0bbbf68d0f4 100644 (file)
@@ -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);