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);
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 {
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);
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,
}
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;
}
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);
}
if (wctx->uninstall)
- zvni_mac_uninstall(wctx->zvni, mac, 0);
+ zvni_mac_uninstall(wctx->zvni, mac);
zvni_mac_del(wctx->zvni, 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) {
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);
}
/*
return;
if (uninstall)
- zvni_mac_uninstall(zvni, mac, 0);
+ zvni_mac_uninstall(zvni, mac);
zvni_mac_del(zvni, mac);
}
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 */
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);