summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util.c b/util.c
index a7c7926..ca12bbf 100644
--- a/util.c
+++ b/util.c
@@ -150,10 +150,12 @@ int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only) {
disable_DF_bit(s,res);
if (reuse)
- setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+ if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1)
+ debugerrno(errno, DBG_WARN, "Failed to set SO_REUSEADDR");
#ifdef IPV6_V6ONLY
if (v6only)
- setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) == -1)
+ debugerrno(errno, DBG_WARN, "Failed to set IPV6_V6ONLY");
#endif
if (!bind(s, res->ai_addr, res->ai_addrlen))
return s;