Skip to content

Commit

Permalink
zebra: Fix crash on macvlan link down/up
Browse files Browse the repository at this point in the history
Whenever a link up change was detected on a macvlan device where
the linked device wasn't visible in the namespace zebra was
running in, the linked zebra interface was NULL. This was already
handled in the event of a link down, but was ommitted from the
upside. Added the same null check to the up-side.

Signed-off-by: Tomi Salminen <[email protected]>
(cherry picked from commit bdf6a9b)
  • Loading branch information
tlsalmin authored and mergify[bot] committed Mar 22, 2024
1 parent efb4f0e commit 1b04eed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zebra/zebra_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -5104,6 +5104,15 @@ void zebra_vxlan_macvlan_up(struct interface *ifp)
return;

link_ifp = zif->link;
if (!link_ifp) {
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug(
"macvlan parent link is not found. Parent index %d ifp %s",
zif->link_ifindex,
ifindex2ifname(zif->link_ifindex,
ifp->vrf->vrf_id));
return;
}
link_zif = link_ifp->info;
assert(link_zif);

Expand Down

0 comments on commit 1b04eed

Please sign in to comment.