]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Fix crash in shutdown w/ pw thread still running
authorDonald Sharp <sharpd@nvidia.com>
Thu, 11 Aug 2022 18:59:17 +0000 (14:59 -0400)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Fri, 12 Aug 2022 07:52:44 +0000 (10:52 +0300)
I am seeing the zebra_pw_install_retry timer thread crashing
on shutdown

The shutdown of the timer is only in an
if () {
   ...
} else if

Let's just always shut it down.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_pw.c

index 7d1153f21f4dd64fcccb206a73a097136b0a5759..fd64d6c5347f2c1c9a2579265d1be291fd83eec7 100644 (file)
@@ -101,13 +101,15 @@ void zebra_pw_del(struct zebra_vrf *zvrf, struct zebra_pw *pw)
        if (pw->status == PW_FORWARDING) {
                hook_call(pw_uninstall, pw);
                dplane_pw_uninstall(pw);
-       } else if (pw->install_retry_timer)
-               thread_cancel(&pw->install_retry_timer);
+       }
+
+       THREAD_OFF(pw->install_retry_timer);
 
        /* unlink and release memory */
        RB_REMOVE(zebra_pw_head, &zvrf->pseudowires, pw);
        if (pw->protocol == ZEBRA_ROUTE_STATIC)
                RB_REMOVE(zebra_static_pw_head, &zvrf->static_pseudowires, pw);
+
        XFREE(MTYPE_PW, pw);
 }
 
@@ -230,7 +232,6 @@ static void zebra_pw_install_retry(struct thread *thread)
 {
        struct zebra_pw *pw = THREAD_ARG(thread);
 
-       pw->install_retry_timer = NULL;
        zebra_pw_install(pw);
 }