From c62774e01e2e424fed9cdb21447a18bdc386fef2 Mon Sep 17 00:00:00 2001 From: shin Date: Thu, 13 Jan 2000 14:21:30 +0000 Subject: Clear rt after RTFREE. This might have sometime caused kernel panic at rtfree() on INET6 enabled environment. --- sys/netinet/tcp_subr.c | 5 ++++- sys/netinet/tcp_timewait.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 811f34c..9ab1dbd 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -451,14 +451,17 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) #ifdef INET6 if (isipv6) { (void)ip6_output(m, NULL, ro6, ipflags, NULL, NULL); - if (ro6 == &sro6 && ro6->ro_rt) + if (ro6 == &sro6 && ro6->ro_rt) { RTFREE(ro6->ro_rt); + ro6->ro_rt = NULL; + } } else #endif /* INET6 */ { (void) ip_output(m, NULL, ro, ipflags, NULL); if (ro == &sro && ro->ro_rt) { RTFREE(ro->ro_rt); + ro->ro_rt = NULL; } } } diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 811f34c..9ab1dbd 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -451,14 +451,17 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) #ifdef INET6 if (isipv6) { (void)ip6_output(m, NULL, ro6, ipflags, NULL, NULL); - if (ro6 == &sro6 && ro6->ro_rt) + if (ro6 == &sro6 && ro6->ro_rt) { RTFREE(ro6->ro_rt); + ro6->ro_rt = NULL; + } } else #endif /* INET6 */ { (void) ip_output(m, NULL, ro, ipflags, NULL); if (ro == &sro && ro->ro_rt) { RTFREE(ro->ro_rt); + ro->ro_rt = NULL; } } } -- cgit v1.1