lib: default VRF may not exist on early exit

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>
This commit is contained in:
David Lamparter 2021-11-11 17:23:55 +01:00
parent b1dc60f4ab
commit b8984d4e90

View File

@ -562,7 +562,8 @@ void vrf_terminate(void)
/* Finally terminate default VRF */ /* Finally terminate default VRF */
vrf = vrf_lookup_by_id(VRF_DEFAULT); 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, int vrf_socket(int domain, int type, int protocol, vrf_id_t vrf_id,