make setsockopt(IPV6_V6ONLY, 0) actuall work for tcp6.
MFC after: 1 week
This commit is contained in:
parent
4454edd688
commit
66ef17c4b6
@ -280,7 +280,7 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
|
||||
}
|
||||
inp->inp_vflag &= ~INP_IPV4;
|
||||
inp->inp_vflag |= INP_IPV6;
|
||||
if (!ip6_v6only && (inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
|
||||
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&sin6p->sin6_addr))
|
||||
inp->inp_vflag |= INP_IPV4;
|
||||
else if (IN6_IS_ADDR_V4MAPPED(&sin6p->sin6_addr)) {
|
||||
@ -333,7 +333,7 @@ tcp6_usr_listen(struct socket *so, struct thread *td)
|
||||
COMMON_START();
|
||||
if (inp->inp_lport == 0) {
|
||||
inp->inp_vflag &= ~INP_IPV4;
|
||||
if (!ip6_v6only && (inp->inp_flags & IN6P_IPV6_V6ONLY) == 0)
|
||||
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0)
|
||||
inp->inp_vflag |= INP_IPV4;
|
||||
error = in6_pcbbind(inp, (struct sockaddr *)0, td);
|
||||
}
|
||||
@ -407,7 +407,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
|
||||
if (IN6_IS_ADDR_V4MAPPED(&sin6p->sin6_addr)) {
|
||||
struct sockaddr_in sin;
|
||||
|
||||
if (ip6_v6only || (inp->inp_flags & IN6P_IPV6_V6ONLY))
|
||||
if ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)
|
||||
return(EINVAL);
|
||||
|
||||
in6_sin6_2_sin(&sin, sin6p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user