]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: default VRF may not exist on early exit 10216/head
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 11 Nov 2021 16:23:55 +0000 (17:23 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 14 Dec 2021 17:12:25 +0000 (18:12 +0100)
If we're exiting before we finished initializing, we can end up trying
to shut down a NULL vrf here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/vrf.c

index b5f06048b784144852d10018ba06342db3edc027..a6250b31a87acaeaf5f62e568ed18da8eb7e5e9d 100644 (file)
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -562,7 +562,8 @@ void vrf_terminate(void)
 
        /* Finally terminate default VRF */
        vrf = vrf_lookup_by_id(VRF_DEFAULT);
-       vrf_terminate_single(vrf);
+       if (vrf)
+               vrf_terminate_single(vrf);
 }
 
 int vrf_socket(int domain, int type, int protocol, vrf_id_t vrf_id,