diff options
| author | Pat Ruddy <pat@voltanet.io> | 2020-04-24 14:50:23 +0100 |
|---|---|---|
| committer | Pat Ruddy <pat@voltanet.io> | 2020-08-12 12:39:34 +0100 |
| commit | 32fe7dfd9b4e02ac15fd73abd358b448fcec4cfc (patch) | |
| tree | 4ad980549d739c2c7efea39dde40ba53a2125f74 /zebra/zebra_vxlan.c | |
| parent | 224315f3e4a9661ef037f53fb4b46b404d43c84d (diff) | |
zebra: extract neighbor processing from process_remote_macip_del
extract the neighbor uninstall part of process_remote_macip_add
into a new function zebra_evpn_neigh_remote_uninstall in
zebra_evpn_neigh.c.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Diffstat (limited to 'zebra/zebra_vxlan.c')
| -rw-r--r-- | zebra/zebra_vxlan.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 7e1791e4d7..0e37b3a43f 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3432,41 +3432,9 @@ static void process_remote_macip_del(vni_t vni, } /* Uninstall remote neighbor or MAC. */ - if (n) { - if (zvrf->dad_freeze && - CHECK_FLAG(n->flags, ZEBRA_NEIGH_DUPLICATE) && - CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE) && - (memcmp(n->emac.octet, macaddr->octet, ETH_ALEN) == 0)) { - struct interface *vlan_if; - - vlan_if = zvni_map_to_svi(vxl->access_vlan, - zif->brslave_info.br_if); - if (IS_ZEBRA_DEBUG_VXLAN) - zlog_debug( - "%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry", - __func__, - ipaddr2str(ipaddr, buf1, sizeof(buf1)), - n->flags, - vlan_if ? vlan_if->name : "Unknown"); - if (vlan_if) - neigh_read_specific_ip(ipaddr, vlan_if); - } - - /* When the MAC changes for an IP, it is possible the - * client may update the new MAC before trying to delete the - * "old" neighbor (as these are two different MACIP routes). - * Do the delete only if the MAC matches. - */ - if (!memcmp(n->emac.octet, macaddr->octet, ETH_ALEN)) { - if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_LOCAL)) { - zebra_evpn_sync_neigh_del(n); - } else if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)) { - zebra_evpn_neigh_uninstall(zevpn, n); - zebra_evpn_neigh_del(zevpn, n); - zebra_evpn_deref_ip2mac(zevpn, mac); - } - } - } else { + if (n) + zebra_evpn_neigh_remote_uninstall(zevpn, zvrf, n, mac, ipaddr); + else { /* DAD: when MAC is freeze state as remote learn event, * remote mac-ip delete event is received will result in freeze * entry removal, first fetch kernel for the same entry present |
