Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Get link from the correct netns for vxlan #8895

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions zebra/zebra_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,6 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
return -1;
}
} else {
struct zebra_ns *zns;
struct route_node *rn;
struct interface *ifp;
struct zebra_if *zif;
Expand All @@ -2399,8 +2398,8 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
vni);

/* Find VxLAN interface for this VNI. */
zns = zebra_ns_lookup(NS_DEFAULT);
for (rn = route_top(zns->if_table); rn; rn = route_next(rn)) {
for (rn = route_top(zvrf->zns->if_table); rn;
rn = route_next(rn)) {
ifp = (struct interface *)rn->info;
if (!ifp)
continue;
Expand Down Expand Up @@ -4893,8 +4892,7 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, const struct prefix *p,
/*
* for a MACVLAN interface the link represents the svi_if
*/
svi_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT),
ifp_zif->link_ifindex);
svi_if = ifp_zif->link;
if (!svi_if) {
zlog_debug("MACVLAN %s(%u) without link information",
ifp->name, ifp->ifindex);
Expand All @@ -4910,9 +4908,7 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, const struct prefix *p,

svi_if_zif = svi_if->info;
if (svi_if_zif) {
svi_if_link = if_lookup_by_index_per_ns(
zebra_ns_lookup(NS_DEFAULT),
svi_if_zif->link_ifindex);
svi_if_link = svi_if_zif->link;
zevpn = zebra_evpn_from_svi(svi_if,
svi_if_link);
}
Expand All @@ -4931,9 +4927,7 @@ int zebra_vxlan_add_del_gw_macip(struct interface *ifp, const struct prefix *p,

svi_if_zif = ifp->info;
if (svi_if_zif) {
svi_if_link = if_lookup_by_index_per_ns(
zebra_ns_lookup(NS_DEFAULT),
svi_if_zif->link_ifindex);
svi_if_link = svi_if_zif->link;
if (svi_if_link)
zevpn = zebra_evpn_from_svi(ifp, svi_if_link);
}
Expand Down Expand Up @@ -5132,8 +5126,7 @@ void zebra_vxlan_macvlan_down(struct interface *ifp)
link_zif = link_ifp->info;
assert(link_zif);

link_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT),
link_zif->link_ifindex);
link_if = link_zif->link;

zl3vni = zl3vni_from_svi(link_ifp, link_if);
if (zl3vni) {
Expand Down Expand Up @@ -5162,8 +5155,7 @@ void zebra_vxlan_macvlan_up(struct interface *ifp)
link_zif = link_ifp->info;
assert(link_zif);

link_if = if_lookup_by_index_per_ns(zebra_ns_lookup(NS_DEFAULT),
link_zif->link_ifindex);
link_if = link_zif->link;
zl3vni = zl3vni_from_svi(link_ifp, link_if);
if (zl3vni) {
/* associate with macvlan (VRR) interface */
Expand Down
Loading