summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2000-04-02 16:11:14 +0000
committerume <ume@FreeBSD.org>2000-04-02 16:11:14 +0000
commit484d3fa1b115d5ed2560c12d2feb1b40639b6ea3 (patch)
treec9c4c8bae614f69c0100e240606ad80d4acf601e /usr.sbin/inetd
parent8ee11d587fcf66a50146b00f04bb5db7b955b795 (diff)
downloadFreeBSD-src-484d3fa1b115d5ed2560c12d2feb1b40639b6ea3.zip
FreeBSD-src-484d3fa1b115d5ed2560c12d2feb1b40639b6ea3.tar.gz
Make sure to use IPv4 mapped IPv6 address when mapped address is
requested in /etc/inetd.conf. Reviewed by: shin
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index a17c4e8..7669d5f 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1136,11 +1136,12 @@ setsockopt(fd, SOL_SOCKET, opt, (char *)&on, sizeof (on))
(char *)&on, sizeof (on)) < 0))
syslog(LOG_ERR, "setsockopt (IPV6_RECVPKTINFO): %m");
#ifdef IPV6_BINDV6ONLY
- if ((sep->se_family == AF_INET6) &&
- (sep->se_nomapped != 0) &&
- (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_BINDV6ONLY,
- (char *)&on, sizeof (on)) < 0))
- syslog(LOG_ERR, "setsockopt (IPV6_BINDV6ONLY): %m");
+ if (sep->se_family == AF_INET6) {
+ int flag = sep->se_nomapped ? 1 : 0;
+ if (setsockopt(sep->se_fd, IPPROTO_IPV6, IPV6_BINDV6ONLY,
+ (char *)&flag, sizeof (flag)) < 0)
+ syslog(LOG_ERR, "setsockopt (IPV6_BINDV6ONLY): %m");
+ }
#endif /* IPV6_BINDV6ONLY */
#undef turnon
if (sep->se_type == TTCP_TYPE)
OpenPOWER on IntegriCloud