]> git.puffer.fish Git - mirror/frr.git/commitdiff
bfdd: Prevent storage of ifp pointer that has been deleted
authorDonald Sharp <sharpd@nvidia.com>
Sat, 30 Jan 2021 20:41:35 +0000 (15:41 -0500)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 16 Feb 2021 17:57:22 +0000 (20:57 +0300)
On shutdown, interfaces are deleted but if the bfd session
is down we retain the interface pointer.  Remove the retained
pointer.

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

index 33f5119e4d6318ffed76db75f7783fc77dc35ace..01e72cca26b7f94809712509f7be01f6c1b9f5cb 100644 (file)
@@ -684,8 +684,10 @@ static void bfdd_sessions_disable_interface(struct interface *ifp)
                if (strcmp(ifp->name, bs->key.ifname))
                        continue;
                /* Skip disabled sessions. */
-               if (bs->sock == -1)
+               if (bs->sock == -1) {
+                       bs->ifp = NULL;
                        continue;
+               }
 
                bfd_session_disable(bs);