From 0cc0f37b5284ab727e4e0bbdc73fc675caf4f74c Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 28 Jun 2017 10:48:48 +0930 Subject: [PATCH] Failures to set socket options should only be warnings --- overlay_interface.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/overlay_interface.c b/overlay_interface.c index 9f9653eb..c913fb62 100644 --- a/overlay_interface.c +++ b/overlay_interface.c @@ -189,22 +189,16 @@ overlay_bind_socket(const struct socket_address *addr){ if (fd < 0) return -1; - if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuseP, sizeof(reuseP)) < 0) { - WHY_perror("setsockopt(SO_REUSEADR)"); - goto error; - } + if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuseP, sizeof(reuseP)) < 0) + WARN_perror("setsockopt(SO_REUSEADR)"); #ifdef SO_REUSEPORT - if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &reuseP, sizeof(reuseP)) < 0) { - WHY_perror("setsockopt(SO_REUSEPORT)"); - goto error; - } + if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &reuseP, sizeof(reuseP)) < 0) + WARN_perror("setsockopt(SO_REUSEPORT)"); #endif - if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &broadcastP, sizeof(broadcastP)) < 0) { - WHY_perror("setsockopt(SO_BROADCAST)"); - goto error; - } + if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &broadcastP, sizeof(broadcastP)) < 0) + WARN_perror("setsockopt(SO_BROADCAST)"); /* Automatically close socket on calls to exec(). This makes life easier when we restart with an exec after receiving