]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: fix crash during candidate validation 5040/head
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 23 Sep 2019 12:37:49 +0000 (09:37 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 23 Sep 2019 17:18:36 +0000 (14:18 -0300)
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 <renato@opensourcerouting.org>
isisd/isis_northbound.c

index bd6191869782312eae9aaa5f5ee732e506261535..d74abd74fbcb14ec2c22d55c7e43e1cf8bc6efc4 100644 (file)
@@ -1542,9 +1542,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;