summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2017-07-30 23:39:07 +0200
committerLinus Nordberg <linus@nordu.net>2017-07-30 23:39:07 +0200
commit4881e8b065767b29fd45294ad8321c6f5029a51b (patch)
treea2caabf0d39acc6e3e69d054570445f57410c5dd
parent3d9be8431e7644e440c58b7132563db0ace0267b (diff)
Don't try to set IPV6_V6ONLY on IPv4 sockets.
This is a long standing, non fatal, bug which was revealed when we started looking at return values from all calls to setsockopt() in the coverity branch.
-rw-r--r--dtls.c2
-rw-r--r--udp.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/dtls.c b/dtls.c
index 1a8f5e5..daeacca 100644
--- a/dtls.c
+++ b/dtls.c
@@ -670,7 +670,7 @@ void addserverextradtls(struct clsrvconf *conf) {
switch (((struct hostportres *)list_first(conf->hostports)->data)->addrinfo->ai_family) {
case AF_INET:
if (client4_sock < 0) {
- client4_sock = bindtoaddr(srcres, AF_INET, 0, 1);
+ client4_sock = bindtoaddr(srcres, AF_INET, 0, 0);
if (client4_sock < 0)
debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name);
}
diff --git a/udp.c b/udp.c
index ff7ad77..273460e 100644
--- a/udp.c
+++ b/udp.c
@@ -320,7 +320,7 @@ void addserverextraudp(struct clsrvconf *conf) {
switch (((struct hostportres *)list_first(conf->hostports)->data)->addrinfo->ai_family) {
case AF_INET:
if (client4_sock < 0) {
- client4_sock = bindtoaddr(srcres, AF_INET, 0, 1);
+ client4_sock = bindtoaddr(srcres, AF_INET, 0, 0);
if (client4_sock < 0)
debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name);
}