]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: When failing to set socket options just note the failure 7279/head
authorDonald Sharp <sharpd@nvidia.com>
Sun, 11 Oct 2020 16:56:02 +0000 (12:56 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Sun, 11 Oct 2020 16:56:02 +0000 (12:56 -0400)
Instead of closing the socket, just note the failure and
continue on.  If we actually failed here so many other
things would not be working at all, that actually
closing the fd won't matter.

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

index 3a1547978a8dd80cb66e8871128c4eb9d4e9054f..28aec41eba77ef8a5be9d4c94780b5c7bbb38bd9 100644 (file)
@@ -201,7 +201,6 @@ int ospf_sock_init(struct ospf *ospf)
                        flog_err(EC_LIB_SOCKET,
                                 "Can't set IP_HDRINCL option for fd %d: %s",
                                 ospf_sock, safe_strerror(errno));
-                       close(ospf_sock);
                        break;
                }
 #elif defined(IPTOS_PREC_INTERNETCONTROL)
@@ -213,7 +212,6 @@ int ospf_sock_init(struct ospf *ospf)
                        flog_err(EC_LIB_SOCKET,
                                 "can't set sockopt IP_TOS %d to socket %d: %s",
                                 tos, ospf_sock, safe_strerror(errno));
-                       close(ospf_sock); /* Prevent sd leak. */
                        break;
                }
 #else /* !IPTOS_PREC_INTERNETCONTROL */