summaryrefslogtreecommitdiff
path: root/radsecproxy.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2017-07-30 22:09:55 +0200
committerLinus Nordberg <linus@nordu.net>2017-07-30 22:12:19 +0200
commitd9e2de1a0d2f60cdf153d7efc5e6563a4764573b (patch)
treef673d5c0d4dafd9dafb60995693060327ec12a57 /radsecproxy.c
parentc329d323515fa2ad25b10cc2fc294f33635ed639 (diff)
Check return value from setsockopt().
coverity: 1449508, 1449522.
Diffstat (limited to 'radsecproxy.c')
-rw-r--r--radsecproxy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index c647ab1..12910ed 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -2019,13 +2019,15 @@ void createlistener(uint8_t type, char *arg) {
debugerrno(errno, DBG_WARN, "createlistener: socket failed");
continue;
}
- setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+ if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) == -1)
+ debugerrno(errno, DBG_WARN, "createlistener: SO_REUSEADDR");
disable_DF_bit(s, res);
#ifdef IPV6_V6ONLY
if (res->ai_family == AF_INET6)
- setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
+ if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) == -1)
+ debugerrno(errno, DBG_WARN, "createlistener: IPV6_V6ONLY");
#endif
if (bind(s, res->ai_addr, res->ai_addrlen)) {
debugerrno(errno, DBG_WARN, "createlistener: bind failed");