aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2017-08-18 07:27:15 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2017-08-18 07:27:15 +0000
commit63ec505a4fe8d63d2a8f114edd0f18f6224eeb36 (patch)
tree5d0ab834510d4a7096bf59efb960374bef8842ec /sys
parente9666bf645105d08bcb6dffd5c36d02f817841b7 (diff)
downloadsrc-63ec505a4fe8d63d2a8f114edd0f18f6224eeb36.tar.gz
src-63ec505a4fe8d63d2a8f114edd0f18f6224eeb36.zip
Ensure inp_vflag is consistently set for TCP endpoints.
Make sure that the flags INP_IPV4 and INP_IPV6 are consistently set for inpcbs used for TCP sockets, no matter if the setting is derived from the net.inet6.ip6.v6only sysctl or the IPV6_V6ONLY socket option. For UDP this was already done right. PR: 221385 MFC after: 1 week
Notes
Notes: svn path=/head/; revision=322648
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_usrreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index f0251290367c..e1bea5ac2cd0 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1918,6 +1918,8 @@ tcp_attach(struct socket *so)
#ifdef INET6
if (inp->inp_vflag & INP_IPV6PROTO) {
inp->inp_vflag |= INP_IPV6;
+ if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0)
+ inp->inp_vflag |= INP_IPV4;
inp->in6p_hops = -1; /* use kernel default */
}
else