mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 02:30:52 +00:00
lib: don't crash on iface add for unknown vrf
If Zebra sends us an interface add notification with a garbage VRF we crash on an assert(vrf_get(vrf_id, NULL)); let's not Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
b98edbccf8
commit
229d0d4edc
@ -1763,6 +1763,13 @@ static int zclient_interface_add(struct zclient *zclient, vrf_id_t vrf_id)
|
|||||||
STREAM_GET(ifname_tmp, s, INTERFACE_NAMSIZ);
|
STREAM_GET(ifname_tmp, s, INTERFACE_NAMSIZ);
|
||||||
|
|
||||||
/* Lookup/create interface by name. */
|
/* Lookup/create interface by name. */
|
||||||
|
if (!vrf_get(vrf_id, NULL)) {
|
||||||
|
zlog_debug(
|
||||||
|
"Rx'd interface add from Zebra, but VRF %u does not exist",
|
||||||
|
vrf_id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ifp = if_get_by_name(ifname_tmp, vrf_id);
|
ifp = if_get_by_name(ifname_tmp, vrf_id);
|
||||||
|
|
||||||
zebra_interface_if_set_value(s, ifp);
|
zebra_interface_if_set_value(s, ifp);
|
||||||
|
Loading…
Reference in New Issue
Block a user