From 078827ad3fedb640e45e079a5d34e2771e04a36f Mon Sep 17 00:00:00 2001 From: Yves Rutschle Date: Thu, 6 Apr 2017 16:26:27 +0200 Subject: [PATCH] Some systems define IP_FREEBIND but don't implement it which result in setsockopt() failing. No need to die in that case, just ignore the error. --- common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common.c b/common.c index 394cdb1..7799b1e 100644 --- a/common.c +++ b/common.c @@ -133,8 +133,12 @@ int start_listen_sockets(int *sockfd[], struct addrinfo *addr_list) if (IP_FREEBIND) { res = setsockopt((*sockfd)[i], IPPROTO_IP, IP_FREEBIND, (char*)&one, sizeof(one)); - check_res_dumpdie(res, addr, "setsockopt(IP_FREEBIND)"); - } + if (res == -1) { + fprintf(stderr, "%s:%s: %s\n", + sprintaddr(buf, sizeof(buf), addr), + syscall, + strerror(errno)); + } res = bind((*sockfd)[i], addr->ai_addr, addr->ai_addrlen); check_res_dumpdie(res, addr, "bind");