From c882c9dd80d1d2007b96132eeb06d1151ea4d30c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 30 Jan 2021 15:41:35 -0500 Subject: [PATCH] bfdd: Prevent storage of ifp pointer that has been deleted 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 --- bfdd/ptm_adapter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 57fb81aa27..db636c9191 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -706,8 +706,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); bs->ifp = NULL; -- 2.39.5