From 8ced966f398123108ad706825caf3ab85bc8b3b0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 11 Oct 2020 12:56:02 -0400 Subject: [PATCH] ospfd: When failing to set socket options just note the failure 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 --- ospfd/ospf_network.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c index 3a1547978a..28aec41eba 100644 --- a/ospfd/ospf_network.c +++ b/ospfd/ospf_network.c @@ -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 */ -- 2.39.5