]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Remove unused parameter in MAC delete
authorvivek <vivek@cumulusnetworks.com>
Wed, 29 Aug 2018 00:02:40 +0000 (17:02 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 18 Sep 2018 14:41:53 +0000 (10:41 -0400)
When a MAC moves from local to remote, a replace is allowed, EVPN
no longer has to delete the local MAC before installing the remote
MAC.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
zebra/rt.h
zebra/rt_netlink.c
zebra/rt_socket.c
zebra/zebra_vxlan.c

index e40bae3a3e475f37a271d21f988ae2106a938984..244b377f865e0bfef7976e7aeaa2496113c357ca 100644 (file)
@@ -118,8 +118,7 @@ extern int kernel_add_mac(struct interface *ifp, vlanid_t vid,
                          struct ethaddr *mac, struct in_addr vtep_ip,
                          uint8_t sticky);
 extern int kernel_del_mac(struct interface *ifp, vlanid_t vid,
-                         struct ethaddr *mac, struct in_addr vtep_ip,
-                         int local);
+                         struct ethaddr *mac, struct in_addr vtep_ip);
 
 extern int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
                            struct ethaddr *mac, uint8_t flags);
index b600a7db50b6d1de1f6069e9eafa31686b789dae..2709dc824e2738fc23d5ad24ea0cba76babcb924 100644 (file)
@@ -2178,7 +2178,7 @@ int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
 
 static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
                                 struct ethaddr *mac, struct in_addr vtep_ip,
-                                int local, int cmd, uint8_t sticky)
+                                int cmd, uint8_t sticky)
 {
        struct zebra_ns *zns;
        struct {
@@ -2223,12 +2223,10 @@ static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
 
        addattr_l(&req.n, sizeof(req), NDA_LLADDR, mac, 6);
        req.ndm.ndm_ifindex = ifp->ifindex;
-       if (!local) {
-               dst_alen = 4; // TODO: hardcoded
-               addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
-               dst_present = 1;
-               sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
-       }
+       dst_alen = 4; // TODO: hardcoded
+       addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
+       dst_present = 1;
+       sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
        br_zif = (struct zebra_if *)br_if->info;
        if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) && vid > 0) {
                addattr16(&req.n, sizeof(req), NDA_VLAN, vid);
@@ -2565,15 +2563,14 @@ static int netlink_neigh_update2(struct interface *ifp, struct ipaddr *ip,
 int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
                   struct in_addr vtep_ip, uint8_t sticky)
 {
-       return netlink_macfdb_update(ifp, vid, mac, vtep_ip, 0, RTM_NEWNEIGH,
+       return netlink_macfdb_update(ifp, vid, mac, vtep_ip, RTM_NEWNEIGH,
                                     sticky);
 }
 
 int kernel_del_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
-                  struct in_addr vtep_ip, int local)
+                  struct in_addr vtep_ip)
 {
-       return netlink_macfdb_update(ifp, vid, mac, vtep_ip, local,
-                                    RTM_DELNEIGH, 0);
+       return netlink_macfdb_update(ifp, vid, mac, vtep_ip, RTM_DELNEIGH, 0);
 }
 
 int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
index a6de84d56fd97644c60eda1251cce9f18e35977c..2a93992ebb731df1984c241d1caaf1dd7ef2c8e2 100644 (file)
@@ -459,7 +459,7 @@ int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
 }
 
 int kernel_del_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
-                  struct in_addr vtep_ip, int local)
+                  struct in_addr vtep_ip)
 {
        return 0;
 }
index 469aceafb93ff4b22b15cb8539853f4bbd36ab9e..7fe2b904a927bba6d548a3e1e7e5773284a773be 100644 (file)
@@ -153,7 +153,7 @@ static int zvni_mac_send_del_to_client(vni_t vni, struct ethaddr *macaddr,
 static zebra_vni_t *zvni_map_vlan(struct interface *ifp,
                                  struct interface *br_if, vlanid_t vid);
 static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac);
-static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac, int local);
+static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac);
 static void zvni_install_mac_hash(struct hash_backet *backet, void *ctxt);
 
 static unsigned int vni_hash_keymake(void *p);
@@ -2309,7 +2309,7 @@ static void zvni_mac_del_hash_entry(struct hash_backet *backet, void *arg)
                }
 
                if (wctx->uninstall)
-                       zvni_mac_uninstall(wctx->zvni, mac, 0);
+                       zvni_mac_uninstall(wctx->zvni, mac);
 
                zvni_mac_del(wctx->zvni, mac);
        }
@@ -2611,18 +2611,16 @@ static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac)
 }
 
 /*
- * Uninstall remote MAC from the kernel. In the scenario where the MAC
- * moves to remote, we have to uninstall any existing local entry first.
+ * Uninstall remote MAC from the kernel.
  */
-static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac, int local)
+static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac)
 {
        struct zebra_if *zif;
        struct zebra_l2info_vxlan *vxl;
        struct in_addr vtep_ip = {.s_addr = 0};
-       struct zebra_ns *zns;
        struct interface *ifp;
 
-       if (!local && !(mac->flags & ZEBRA_MAC_REMOTE))
+       if (!(mac->flags & ZEBRA_MAC_REMOTE))
                return 0;
 
        if (!zvni->vxlan_if) {
@@ -2636,19 +2634,10 @@ static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac, int local)
                return -1;
        vxl = &zif->l2info.vxl;
 
-       if (local) {
-               zns = zebra_ns_lookup(NS_DEFAULT);
-               ifp = if_lookup_by_index_per_ns(zns,
-                                               mac->fwd_info.local.ifindex);
-               if (!ifp) // unexpected
-                       return -1;
-       } else {
-               ifp = zvni->vxlan_if;
-               vtep_ip = mac->fwd_info.r_vtep_ip;
-       }
+       ifp = zvni->vxlan_if;
+       vtep_ip = mac->fwd_info.r_vtep_ip;
 
-       return kernel_del_mac(ifp, vxl->access_vlan, &mac->macaddr, vtep_ip,
-                             local);
+       return kernel_del_mac(ifp, vxl->access_vlan, &mac->macaddr, vtep_ip);
 }
 
 /*
@@ -2677,7 +2666,7 @@ static void zvni_deref_ip2mac(zebra_vni_t *zvni, zebra_mac_t *mac,
                return;
 
        if (uninstall)
-               zvni_mac_uninstall(zvni, mac, 0);
+               zvni_mac_uninstall(zvni, mac);
 
        zvni_mac_del(zvni, mac);
 }
@@ -3290,7 +3279,7 @@ static int zl3vni_rmac_uninstall(zebra_l3vni_t *zl3vni, zebra_mac_t *zrmac)
        vxl = &zif->l2info.vxl;
 
        return kernel_del_mac(zl3vni->vxlan_if, vxl->access_vlan,
-                             &zrmac->macaddr, zrmac->fwd_info.r_vtep_ip, 0);
+                             &zrmac->macaddr, zrmac->fwd_info.r_vtep_ip);
 }
 
 /* handle rmac add */
@@ -4391,7 +4380,7 @@ static void process_remote_macip_del(vni_t vni,
                        zvni_process_neigh_on_remote_mac_del(zvni, mac);
 
                        if (list_isempty(mac->neigh_list)) {
-                               zvni_mac_uninstall(zvni, mac, 0);
+                               zvni_mac_uninstall(zvni, mac);
                                zvni_mac_del(zvni, mac);
                        } else
                                SET_FLAG(mac->flags, ZEBRA_MAC_AUTO);