]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix double close of socket.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 24 Aug 2016 12:20:38 +0000 (08:20 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:07 +0000 (20:26 -0500)
When a interface bounces fix the double close from happening

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_pim.c

index f58e326d1669a328a69ab819a6e6c8d4ca2168d7..4924acea74d1e089849694451241ee48b1f72331 100644 (file)
@@ -90,7 +90,10 @@ static void sock_close(struct interface *ifp)
               pim_ifp->pim_sock_fd, ifp->name);
   }
 
-  if (close(pim_ifp->pim_sock_fd)) {
+  /*
+   * If the fd is already deleted no need to do anything here
+   */
+  if (pim_ifp->pim_sock_fd > 0 && close(pim_ifp->pim_sock_fd)) {
     zlog_warn("Failure closing PIM socket fd=%d on interface %s: errno=%d: %s",
              pim_ifp->pim_sock_fd, ifp->name,
              errno, safe_strerror(errno));
@@ -98,11 +101,6 @@ static void sock_close(struct interface *ifp)
   
   pim_ifp->pim_sock_fd = -1;
   pim_ifp->pim_sock_creation = 0;
-
-  zassert(pim_ifp->pim_sock_fd < 0);
-  zassert(!pim_ifp->t_pim_sock_read);
-  zassert(!pim_ifp->t_pim_hello_timer);
-  zassert(!pim_ifp->pim_sock_creation);
 }
 
 void pim_sock_delete(struct interface *ifp, const char *delete_message)