mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 20:51:17 +00:00
zebra: Remove unused parameter in MAC delete
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>
This commit is contained in:
parent
dc790ba83d
commit
d63c1b18b4
@ -118,8 +118,7 @@ extern int kernel_add_mac(struct interface *ifp, vlanid_t vid,
|
|||||||
struct ethaddr *mac, struct in_addr vtep_ip,
|
struct ethaddr *mac, struct in_addr vtep_ip,
|
||||||
uint8_t sticky);
|
uint8_t sticky);
|
||||||
extern int kernel_del_mac(struct interface *ifp, vlanid_t vid,
|
extern int kernel_del_mac(struct interface *ifp, vlanid_t vid,
|
||||||
struct ethaddr *mac, struct in_addr vtep_ip,
|
struct ethaddr *mac, struct in_addr vtep_ip);
|
||||||
int local);
|
|
||||||
|
|
||||||
extern int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
|
extern int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
|
||||||
struct ethaddr *mac, uint8_t flags);
|
struct ethaddr *mac, uint8_t flags);
|
||||||
|
@ -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,
|
static int netlink_macfdb_update(struct interface *ifp, vlanid_t vid,
|
||||||
struct ethaddr *mac, struct in_addr vtep_ip,
|
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 zebra_ns *zns;
|
||||||
struct {
|
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);
|
addattr_l(&req.n, sizeof(req), NDA_LLADDR, mac, 6);
|
||||||
req.ndm.ndm_ifindex = ifp->ifindex;
|
req.ndm.ndm_ifindex = ifp->ifindex;
|
||||||
if (!local) {
|
dst_alen = 4; // TODO: hardcoded
|
||||||
dst_alen = 4; // TODO: hardcoded
|
addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
|
||||||
addattr_l(&req.n, sizeof(req), NDA_DST, &vtep_ip, dst_alen);
|
dst_present = 1;
|
||||||
dst_present = 1;
|
sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
|
||||||
sprintf(dst_buf, " dst %s", inet_ntoa(vtep_ip));
|
|
||||||
}
|
|
||||||
br_zif = (struct zebra_if *)br_if->info;
|
br_zif = (struct zebra_if *)br_if->info;
|
||||||
if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) && vid > 0) {
|
if (IS_ZEBRA_IF_BRIDGE_VLAN_AWARE(br_zif) && vid > 0) {
|
||||||
addattr16(&req.n, sizeof(req), NDA_VLAN, vid);
|
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,
|
int kernel_add_mac(struct interface *ifp, vlanid_t vid, struct ethaddr *mac,
|
||||||
struct in_addr vtep_ip, uint8_t sticky)
|
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);
|
sticky);
|
||||||
}
|
}
|
||||||
|
|
||||||
int kernel_del_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 netlink_macfdb_update(ifp, vid, mac, vtep_ip, local,
|
return netlink_macfdb_update(ifp, vid, mac, vtep_ip, RTM_DELNEIGH, 0);
|
||||||
RTM_DELNEIGH, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
|
int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
|
||||||
|
@ -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,
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -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,
|
static zebra_vni_t *zvni_map_vlan(struct interface *ifp,
|
||||||
struct interface *br_if, vlanid_t vid);
|
struct interface *br_if, vlanid_t vid);
|
||||||
static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac);
|
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 void zvni_install_mac_hash(struct hash_backet *backet, void *ctxt);
|
||||||
|
|
||||||
static unsigned int vni_hash_keymake(void *p);
|
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)
|
if (wctx->uninstall)
|
||||||
zvni_mac_uninstall(wctx->zvni, mac, 0);
|
zvni_mac_uninstall(wctx->zvni, mac);
|
||||||
|
|
||||||
zvni_mac_del(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
|
* Uninstall remote MAC from the kernel.
|
||||||
* moves to remote, we have to uninstall any existing local entry first.
|
|
||||||
*/
|
*/
|
||||||
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_if *zif;
|
||||||
struct zebra_l2info_vxlan *vxl;
|
struct zebra_l2info_vxlan *vxl;
|
||||||
struct in_addr vtep_ip = {.s_addr = 0};
|
struct in_addr vtep_ip = {.s_addr = 0};
|
||||||
struct zebra_ns *zns;
|
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
|
|
||||||
if (!local && !(mac->flags & ZEBRA_MAC_REMOTE))
|
if (!(mac->flags & ZEBRA_MAC_REMOTE))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!zvni->vxlan_if) {
|
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;
|
return -1;
|
||||||
vxl = &zif->l2info.vxl;
|
vxl = &zif->l2info.vxl;
|
||||||
|
|
||||||
if (local) {
|
ifp = zvni->vxlan_if;
|
||||||
zns = zebra_ns_lookup(NS_DEFAULT);
|
vtep_ip = mac->fwd_info.r_vtep_ip;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
return kernel_del_mac(ifp, vxl->access_vlan, &mac->macaddr, vtep_ip,
|
return kernel_del_mac(ifp, vxl->access_vlan, &mac->macaddr, vtep_ip);
|
||||||
local);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2677,7 +2666,7 @@ static void zvni_deref_ip2mac(zebra_vni_t *zvni, zebra_mac_t *mac,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (uninstall)
|
if (uninstall)
|
||||||
zvni_mac_uninstall(zvni, mac, 0);
|
zvni_mac_uninstall(zvni, mac);
|
||||||
|
|
||||||
zvni_mac_del(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;
|
vxl = &zif->l2info.vxl;
|
||||||
|
|
||||||
return kernel_del_mac(zl3vni->vxlan_if, vxl->access_vlan,
|
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 */
|
/* 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);
|
zvni_process_neigh_on_remote_mac_del(zvni, mac);
|
||||||
|
|
||||||
if (list_isempty(mac->neigh_list)) {
|
if (list_isempty(mac->neigh_list)) {
|
||||||
zvni_mac_uninstall(zvni, mac, 0);
|
zvni_mac_uninstall(zvni, mac);
|
||||||
zvni_mac_del(zvni, mac);
|
zvni_mac_del(zvni, mac);
|
||||||
} else
|
} else
|
||||||
SET_FLAG(mac->flags, ZEBRA_MAC_AUTO);
|
SET_FLAG(mac->flags, ZEBRA_MAC_AUTO);
|
||||||
|
Loading…
Reference in New Issue
Block a user