summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2000-07-05 22:51:09 +0000
committeritojun <itojun@openbsd.org>2000-07-05 22:51:09 +0000
commitd4ec8fc2f215de34c7db1b87939e9f01986eee21 (patch)
tree6d42fdd31da81a98d8d1af09ef4133b40160136c /sys/netinet/tcp_usrreq.c
parentoops, late night typo (diff)
downloadwireguard-openbsd-d4ec8fc2f215de34c7db1b87939e9f01986eee21.tar.xz
wireguard-openbsd-d4ec8fc2f215de34c7db1b87939e9f01986eee21.zip
more cleanup for IPv4 mapped address support. there seem to be some
inconsistency in corner cases (from NRL I believe). todd (fries) and I have seen panic, with the following call chain: ip6_input -> tcp_input -> tcp_respond -> ip_input -> bang! more cleanups should be done, to decrease complexity. for example, INP_IPV6_MAPPED should be nuked.
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 7bd8b4c6240..ad9c8b8cbb5 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.43 2000/06/18 15:13:33 deraadt Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.44 2000/07/05 22:51:10 itojun Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -213,7 +213,7 @@ tcp_usrreq(so, req, m, nam, control)
error = in_pcbbind(inp, nam);
if (error)
break;
-#ifdef INET6
+#if 0 /*INET6*/
/*
* If we bind to an address, set up the tp->pf accordingly!
*/
@@ -305,7 +305,7 @@ tcp_usrreq(so, req, m, nam, control)
if (error)
break;
-#ifdef INET6
+#if 0 /*INET6*/
/*
* With a connection, I now know the version of IP
* is in use and hence can set tp->pf with authority.
@@ -326,7 +326,7 @@ tcp_usrreq(so, req, m, nam, control)
break;
}
-#ifdef INET6
+#if 0 /*INET6*/
if ((inp->inp_flags & INP_IPV6) && (tp->pf == PF_INET)) {
inp->inp_ip.ip_ttl = ip_defttl;
inp->inp_ip.ip_tos = 0;
@@ -716,6 +716,15 @@ tcp_attach(so)
return (ENOBUFS);
}
tp->t_state = TCPS_CLOSED;
+#ifdef INET6
+ /* we disallow IPv4 mapped address completely. */
+ if (inp->inp_flags & INP_IPV6)
+ tp->pf = PF_INET6;
+ else
+ tp->pf = PF_INET;
+#else
+ tp->pf = PF_INET;
+#endif
return (0);
}