summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-04-01 22:35:47 +0000
committershin <shin@FreeBSD.org>2000-04-01 22:35:47 +0000
commit09037f119d2c35c390f84835c3d3c3cf94edebac (patch)
tree7ddb7387fe3b1afce957dd83bcb7a07caca09946 /sys/netinet/tcp_usrreq.c
parent79ce44e00159f8824aacf50b6227f404788f59ad (diff)
downloadFreeBSD-src-09037f119d2c35c390f84835c3d3c3cf94edebac.zip
FreeBSD-src-09037f119d2c35c390f84835c3d3c3cf94edebac.tar.gz
Support per socket based IPv4 mapped IPv6 addr enable/disable control.
Submitted by: ume
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 7ae34e9..6feb666 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -238,7 +238,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct proc *p)
}
inp->inp_vflag &= ~INP_IPV4;
inp->inp_vflag |= INP_IPV6;
- if (ip6_mapped_addr_on && (inp->inp_flags & IN6P_BINDV6ONLY) == NULL) {
+ if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0) {
if (IN6_IS_ADDR_UNSPECIFIED(&sin6p->sin6_addr))
inp->inp_vflag |= INP_IPV4;
@@ -290,8 +290,7 @@ tcp6_usr_listen(struct socket *so, struct proc *p)
COMMON_START();
if (inp->inp_lport == 0) {
inp->inp_vflag &= ~INP_IPV4;
- if (ip6_mapped_addr_on &&
- (inp->inp_flags & IN6P_BINDV6ONLY) == NULL)
+ if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0)
inp->inp_vflag |= INP_IPV4;
error = in6_pcbbind(inp, (struct sockaddr *)0, p);
}
@@ -359,7 +358,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct proc *p)
goto out;
}
- if (ip6_mapped_addr_on &&
+ if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0 &&
IN6_IS_ADDR_V4MAPPED(&sin6p->sin6_addr)) {
struct sockaddr_in sin;
OpenPOWER on IntegriCloud