summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_timer.c
diff options
context:
space:
mode:
authorcmetz <cmetz@cvs.openbsd.org>1999-07-02 20:39:09 +0000
committercmetz <cmetz@cvs.openbsd.org>1999-07-02 20:39:09 +0000
commitc876f9efb3b83f94108fa2967b221cbd0d561957 (patch)
tree0e640a9c328f7568219a36fecf45683f61a0b486 /sys/netinet/tcp_timer.c
parentc32e9f278eee5d56ba2a77dd005657f17c956ca4 (diff)
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_timer.c')
-rw-r--r--sys/netinet/tcp_timer.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index c281fda1841..e8017b293b3 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_timer.c,v 1.12 1999/04/21 21:38:58 provos Exp $ */
+/* $OpenBSD: tcp_timer.c,v 1.13 1999/07/02 20:39:08 cmetz Exp $ */
/* $NetBSD: tcp_timer.c,v 1.14 1996/02/13 23:44:09 christos Exp $ */
/*
@@ -349,11 +349,15 @@ tcp_timers(tp, timer)
* The keepalive packet must have nonzero length
* to get a 4.2 host to respond.
*/
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt - 1, tp->snd_una - 1, 0);
+ tcp_respond(tp,
+ mtod(tp->t_template, caddr_t),
+ (struct mbuf *)NULL,
+ tp->rcv_nxt - 1, tp->snd_una - 1, 0);
#else
- tcp_respond(tp, tp->t_template, (struct mbuf *)NULL,
- tp->rcv_nxt, tp->snd_una - 1, 0);
+ tcp_respond(tp,
+ mtod(tp->t_template, caddr_t),
+ (struct mbuf *)NULL,
+ tp->rcv_nxt, tp->snd_una - 1, 0);
#endif
tp->t_timer[TCPT_KEEP] = tcp_keepintvl;
} else