summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_timewait.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1996-03-22 18:11:25 +0000
committerwollman <wollman@FreeBSD.org>1996-03-22 18:11:25 +0000
commita24ad9f08290ffabec7529680b7ce6f95e98bf43 (patch)
treefdade047951c03d4d0021b3335fbd4f3606ec894 /sys/netinet/tcp_timewait.c
parentacfe4c4467db308020c97e72d3b390ee773f337c (diff)
downloadFreeBSD-src-a24ad9f08290ffabec7529680b7ce6f95e98bf43.zip
FreeBSD-src-a24ad9f08290ffabec7529680b7ce6f95e98bf43.tar.gz
Make sure tcp_respond() always calls ip_output() with a valid
route pointer. This has no effect in the current ip_output(), but my version requires that ip_output() always be passed a route.
Diffstat (limited to 'sys/netinet/tcp_timewait.c')
-rw-r--r--sys/netinet/tcp_timewait.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index cb03111..6a1f903 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95
- * $Id: tcp_subr.c,v 1.25 1995/12/20 17:42:28 wollman Exp $
+ * $Id: tcp_subr.c,v 1.26 1996/03/11 15:13:33 davidg Exp $
*/
#include <sys/param.h>
@@ -177,10 +177,14 @@ tcp_respond(tp, ti, m, ack, seq, flags)
register int tlen;
int win = 0;
struct route *ro = 0;
+ struct route sro;
if (tp) {
win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
ro = &tp->t_inpcb->inp_route;
+ } else {
+ ro = &sro;
+ bzero(ro, sizeof *ro);
}
if (m == 0) {
m = m_gethdr(M_DONTWAIT, MT_HEADER);
@@ -232,6 +236,9 @@ tcp_respond(tp, ti, m, ack, seq, flags)
tcp_trace(TA_OUTPUT, 0, tp, ti, 0);
#endif
(void) ip_output(m, NULL, ro, 0, NULL);
+ if (ro == &sro) {
+ RTFREE(ro->ro_rt);
+ }
}
/*
OpenPOWER on IntegriCloud