summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libexec/ftpd/ftpd.c6
-rw-r--r--usr.sbin/inetd/inetd.c6
-rw-r--r--usr.sbin/mountd/mountd.c4
-rw-r--r--usr.sbin/nfsd/nfsd.c5
-rw-r--r--usr.sbin/rpcbind/rpcbind.c2
-rw-r--r--usr.sbin/syslogd/syslogd.c4
6 files changed, 10 insertions, 17 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index fe83eca..20b9249 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -457,14 +457,12 @@ main(int argc, char *argv[], char **envp)
if (setsockopt(ctl_sock, SOL_SOCKET, SO_REUSEADDR,
(char *)&on, sizeof(on)) < 0)
syslog(LOG_ERR, "control setsockopt: %m");
-#ifdef IPV6_BINDV6ONLY
if (family == AF_INET6 && enable_v4 == 0) {
- if (setsockopt(ctl_sock, IPPROTO_IPV6, IPV6_BINDV6ONLY,
+ if (setsockopt(ctl_sock, IPPROTO_IPV6, IPV6_V6ONLY,
(char *)&on, sizeof (on)) < 0)
syslog(LOG_ERR,
- "control setsockopt(IPV6_BINDV6ONLY): %m");
+ "control setsockopt(IPV6_V6ONLY): %m");
}
-#endif /* IPV6_BINDV6ONLY */
memcpy(&server_addr, res->ai_addr, res->ai_addr->sa_len);
if (bind(ctl_sock, (struct sockaddr *)&server_addr,
server_addr.su_len) < 0) {
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 9bf9c79..163e0df 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1209,14 +1209,12 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on))
(setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_PKTINFO,
(char *)&on, sizeof (on)) < 0))
syslog(LOG_ERR, "setsockopt (IPV6_RECVPKTINFO): %m");
-#ifdef IPV6_BINDV6ONLY
if (sep->se_family == AF_INET6) {
int flag = sep->se_nomapped ? 1 : 0;
- if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_BINDV6ONLY,
+ if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_V6ONLY,
(char *)&flag, sizeof (flag)) < 0)
- syslog(LOG_ERR, "setsockopt (IPV6_BINDV6ONLY): %m");
+ syslog(LOG_ERR, "setsockopt (IPV6_V6ONLY): %m");
}
-#endif /* IPV6_BINDV6ONLY */
#undef turnon
if (sep->se_type == TTCP_TYPE)
if (setsockopt(sep->se_fd, IPPROTO_TCP, TCP_NOPUSH,
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 2798915..49d5454 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -362,12 +362,12 @@ main(argc, argv)
* by default on NFS sockets too.
*/
if (udp6sock != -1 && setsockopt(udp6sock, IPPROTO_IPV6,
- IPV6_BINDV6ONLY, &one, sizeof one) < 0){
+ IPV6_V6ONLY, &one, sizeof one) < 0){
syslog(LOG_ERR, "can't disable v4-in-v6 on UDP socket");
exit(1);
}
if (tcp6sock != -1 && setsockopt(tcp6sock, IPPROTO_IPV6,
- IPV6_BINDV6ONLY, &one, sizeof one) < 0){
+ IPV6_V6ONLY, &one, sizeof one) < 0){
syslog(LOG_ERR, "can't disable v4-in-v6 on UDP socket");
exit(1);
}
diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c
index 77a8f18..97302e3 100644
--- a/usr.sbin/nfsd/nfsd.c
+++ b/usr.sbin/nfsd/nfsd.c
@@ -438,8 +438,7 @@ main(argc, argv, envp)
"can't create udp6 socket");
nfsd_exit(1);
}
- if (setsockopt(sock, IPPROTO_IPV6,
- IPV6_BINDV6ONLY,
+ if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
&on, sizeof on) < 0) {
syslog(LOG_ERR,
"can't set v6-only binding for "
@@ -581,7 +580,7 @@ main(argc, argv, envp)
syslog(LOG_ERR,
"setsockopt SO_REUSEADDR: %m");
if (setsockopt(tcp6sock, IPPROTO_IPV6,
- IPV6_BINDV6ONLY, &on, sizeof on) < 0) {
+ IPV6_V6ONLY, &on, sizeof on) < 0) {
syslog(LOG_ERR,
"can't set v6-only binding for tcp6 "
"socket: %m");
diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c
index 598ab6a..3f60941 100644
--- a/usr.sbin/rpcbind/rpcbind.c
+++ b/usr.sbin/rpcbind/rpcbind.c
@@ -339,7 +339,7 @@ init_transport(struct netconfig *nconf)
continue;
}
if (setsockopt(fd, IPPROTO_IPV6,
- IPV6_BINDV6ONLY, &on, sizeof on) < 0) {
+ IPV6_V6ONLY, &on, sizeof on) < 0) {
syslog(LOG_ERR, "can't set v6-only binding for "
"udp6 socket: %m");
continue;
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index dc7e8b4..7f988d5 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -2370,17 +2370,15 @@ socksetup(int af, const char *bindhostname)
logerror("socket");
continue;
}
-#ifdef IPV6_BINDV6ONLY
if (r->ai_family == AF_INET6) {
int on = 1;
- if (setsockopt(*s, IPPROTO_IPV6, IPV6_BINDV6ONLY,
+ if (setsockopt(*s, IPPROTO_IPV6, IPV6_V6ONLY,
(char *)&on, sizeof (on)) < 0) {
logerror("setsockopt");
close(*s);
continue;
}
}
-#endif
if (bind(*s, r->ai_addr, r->ai_addrlen) < 0) {
close(*s);
logerror("bind");
OpenPOWER on IntegriCloud