diff options
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/in_pcb.c | 9 | ||||
| -rw-r--r-- | sys/netinet/tcp_input.c | 2 | ||||
| -rw-r--r-- | sys/netinet/tcp_reass.c | 2 | ||||
| -rw-r--r-- | sys/netinet/tcp_usrreq.c | 7 |
4 files changed, 12 insertions, 8 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 020987ea99b9..d042c0b42f68 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -153,6 +153,10 @@ in_pcballoc(so, pcbinfo, p) inp->inp_gencnt = ++pcbinfo->ipi_gencnt; inp->inp_pcbinfo = pcbinfo; inp->inp_socket = so; + if (ip6_mapped_addr_on) + inp->inp_flags &= ~IN6P_BINDV6ONLY; + else + inp->inp_flags |= IN6P_BINDV6ONLY; LIST_INSERT_HEAD(pcbinfo->listhead, inp, inp_list); pcbinfo->ipi_count++; so->so_pcb = (caddr_t)inp; @@ -231,7 +235,8 @@ in_pcbbind(inp, nam, p) (so->so_cred->cr_uid != t->inp_socket->so_cred->cr_uid)) { #if defined(INET6) - if (ip6_mapped_addr_on == 0 || + if ((inp->inp_flags & + IN6P_BINDV6ONLY) != 0 || ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != @@ -247,7 +252,7 @@ in_pcbbind(inp, nam, p) if (t && (reuseport & t->inp_socket->so_options) == 0) { #if defined(INET6) - if (ip6_mapped_addr_on == 0 || + if ((inp->inp_flags & IN6P_BINDV6ONLY) != 0 || ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index dc8ba3c1b906..ade6f79c3c25 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -740,7 +740,7 @@ findpcb: if (isipv6) inp->in6p_laddr = ip6->ip6_dst; else { - if (ip6_mapped_addr_on) { + if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0) { inp->inp_vflag &= ~INP_IPV6; inp->inp_vflag |= INP_IPV4; } diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index dc8ba3c1b906..ade6f79c3c25 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -740,7 +740,7 @@ findpcb: if (isipv6) inp->in6p_laddr = ip6->ip6_dst; else { - if (ip6_mapped_addr_on) { + if ((inp->inp_flags & IN6P_BINDV6ONLY) == 0) { inp->inp_vflag &= ~INP_IPV6; inp->inp_vflag |= INP_IPV4; } diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 7ae34e984593..6feb666e7d11 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; |
