diff options
author | Linus Nordberg <linus@nordberg.se> | 2017-11-20 15:25:24 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2017-11-20 15:25:24 +0100 |
commit | 1e8f4c7ee2282dc96e25476053e149f5d74a2c24 (patch) | |
tree | 486e6dee82da82829bbb55a4e3db5c6620d16cf7 | |
parent | 43fbf47980a99404040f157ad4b01f2b56ff21cf (diff) |
See RADSECPROXY-79 for rationale.
-rw-r--r-- | dtls.c | 6 | ||||
-rw-r--r-- | udp.c | 6 | ||||
-rw-r--r-- | util.c | 6 | ||||
-rw-r--r-- | util.h | 4 |
4 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,5 @@ /* Copyright (c) 2007-2009, UNINETT AS - * Copyright (c) 2012,2016 NORDUnet A/S */ + * Copyright (c) 2012,2016-2017, NORDUnet A/S */ /* See LICENSE for licensing information. */ #include <signal.h> @@ -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, 0); + client4_sock = bindtoaddr(srcres, AF_INET, 0); if (client4_sock < 0) debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name); } @@ -678,7 +678,7 @@ void addserverextradtls(struct clsrvconf *conf) { break; case AF_INET6: if (client6_sock < 0) { - client6_sock = bindtoaddr(srcres, AF_INET6, 0, 1); + client6_sock = bindtoaddr(srcres, AF_INET6, 0); if (client6_sock < 0) debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name); } @@ -1,5 +1,5 @@ /* Copyright (c) 2007-2009, UNINETT AS - * Copyright (c) 2012, NORDUnet A/S */ + * Copyright (c) 2012-2013, 2017, NORDUnet A/S */ /* See LICENSE for licensing information. */ #include <signal.h> @@ -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, 0); + client4_sock = bindtoaddr(srcres, AF_INET, 0); if (client4_sock < 0) debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name); } @@ -328,7 +328,7 @@ void addserverextraudp(struct clsrvconf *conf) { break; case AF_INET6: if (client6_sock < 0) { - client6_sock = bindtoaddr(srcres, AF_INET6, 0, 1); + client6_sock = bindtoaddr(srcres, AF_INET6, 0); if (client6_sock < 0) debugx(1, DBG_ERR, "addserver: failed to create client socket for server %s", conf->name); } @@ -123,7 +123,7 @@ void disable_DF_bit(int socket, struct addrinfo *res) { } } -int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only) { +int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse) { int s, on = 1; struct addrinfo *res; @@ -142,7 +142,7 @@ int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only) { 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) + if (family == AF_INET6) if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) == -1) debugerrno(errno, DBG_WARN, "Failed to set IPV6_V6ONLY"); #endif @@ -204,7 +204,7 @@ int connecttcp(struct addrinfo *addrinfo, struct addrinfo *src, uint16_t timeout } for (res = addrinfo; res; res = res->ai_next) { - s = bindtoaddr(src, res->ai_family, 1, 1); + s = bindtoaddr(src, res->ai_family, 1); if (s < 0) { debug(DBG_WARN, "connecttoserver: socket failed"); continue; @@ -1,5 +1,5 @@ /* Copyright (c) 2007-2009, UNINETT AS - * Copyright (c) 2016, NORDUnet A/S */ + * Copyright (c) 2016-2017, NORDUnet A/S */ /* See LICENSE for licensing information. */ #include <sys/socket.h> @@ -20,7 +20,7 @@ void port_set(struct sockaddr *sa, uint16_t port); void printfchars(char *prefixfmt, char *prefix, char *charfmt, uint8_t *chars, int len); void disable_DF_bit(int socket, struct addrinfo *res); -int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse, int v6only); +int bindtoaddr(struct addrinfo *addrinfo, int family, int reuse); int connecttcp(struct addrinfo *addrinfo, struct addrinfo *src, uint16_t timeout); |