From 952ef7cc90be488d6159b09de9c16eeabf36adc9 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Mon, 23 Sep 2019 09:37:49 -0300 Subject: [PATCH] isisd: fix crash during candidate validation The "abort_if_not_found" parameter of nb_running_get_entry() should be set to true only when this function is called during the NB_EV_APPLY phase of a northbound callback. Failure to respect this can lead to crashes when multiple configuration changes are being committed at the same time. Signed-off-by: Renato Westphal --- isisd/isis_northbound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isisd/isis_northbound.c b/isisd/isis_northbound.c index c1b630eb2d..de7ffe1c81 100644 --- a/isisd/isis_northbound.c +++ b/isisd/isis_northbound.c @@ -1534,9 +1534,9 @@ static int lib_interface_isis_create(enum nb_event event, /* check if interface mtu is sufficient. If the area has not * been created yet, assume default MTU for the area */ - ifp = nb_running_get_entry(dnode, NULL, true); + ifp = nb_running_get_entry(dnode, NULL, false); /* zebra might not know yet about the MTU - nothing we can do */ - if (ifp->mtu == 0) + if (!ifp || ifp->mtu == 0) break; actual_mtu = if_is_broadcast(ifp) ? ifp->mtu - LLC_LEN : ifp->mtu;