]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix crash on macvlan link down/up
authorTomi Salminen <tlsalmin@gmail.com>
Wed, 13 Dec 2023 09:37:21 +0000 (11:37 +0200)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Fri, 22 Mar 2024 12:32:05 +0000 (12:32 +0000)
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 <tlsalmin@gmail.com>
(cherry picked from commit bdf6a9ba810b58146371e8a0000397d2ae9ea956)

zebra/zebra_vxlan.c

index 3e6fb36376001cbc8d417e1053ce4746ee09194d..00991665cab6e889a48e9384402cc5b90c547a76 100644 (file)
@@ -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);