summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_debug.c
diff options
context:
space:
mode:
authorcmetz <cmetz@openbsd.org>1999-07-02 20:39:07 +0000
committercmetz <cmetz@openbsd.org>1999-07-02 20:39:07 +0000
commita237783bf990a3ac2cc58476b3870547b43fe612 (patch)
tree0acf8b74d0292849eda10f49c5ef75b13d813006 /sys/netinet/tcp_debug.c
parentconsistent .Dd usage; proper format is: .Dd Month DD, YYYY (diff)
downloadwireguard-openbsd-a237783bf990a3ac2cc58476b3870547b43fe612.tar.xz
wireguard-openbsd-a237783bf990a3ac2cc58476b3870547b43fe612.zip
Significant cleanups in the way TCP is made to handle multiple network
protocols. "struct tcpiphdr" is now gone from much of the code, as are separate pointers for ti and ti6. The result is fewer variables, which is generally a good thing. Simple if(is_ipv6) ... else ... tests are gone in favor of a switch(protocol family), which allows future new protocols to be added easily. This also makes it possible for someone so inclined to re-implement TUBA (TCP over CLNP?) and do it right instead of the kluged way it was done in 4.4. The TCP header template is now referenced through a mbuf rather than done through a data pointer and dtom()ed as needed. This is partly because dtom() is evil and partly because max_linkhdr + IPv6 + TCP + MSS/TS/SACK opts won't fit inside a packet header mbuf, so we need to grab a cluster for that (which the code now does, if needed).
Diffstat (limited to 'sys/netinet/tcp_debug.c')
-rw-r--r--sys/netinet/tcp_debug.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c
index a728744b64f..9adb1879804 100644
--- a/sys/netinet/tcp_debug.c
+++ b/sys/netinet/tcp_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_debug.c,v 1.4 1999/01/11 02:01:35 deraadt Exp $ */
+/* $OpenBSD: tcp_debug.c,v 1.5 1999/07/02 20:39:07 cmetz Exp $ */
/* $NetBSD: tcp_debug.c,v 1.10 1996/02/13 23:43:36 christos Exp $ */
/*
@@ -92,10 +92,10 @@ int tcpconsdebug = 0;
* Tcp debug routines
*/
void
-tcp_trace(act, ostate, tp, ti, req, len)
+tcp_trace(act, ostate, tp, headers, req, len)
short act, ostate;
struct tcpcb *tp;
- struct tcpiphdr *ti;
+ caddr_t headers;
int req;
int len;
{
@@ -104,6 +104,7 @@ tcp_trace(act, ostate, tp, ti, req, len)
int flags;
#endif
struct tcp_debug *td = &tcp_debug[tcp_debx++];
+ struct tcpiphdr *ti = (struct tcpiphdr *)headers;
#ifdef INET6
struct tcphdr *th;
struct tcpipv6hdr *ti6 = (struct tcpipv6hdr *)ti;