summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2006-04-05 08:45:59 +0000
committerrwatson <rwatson@FreeBSD.org>2006-04-05 08:45:59 +0000
commit4f906aab35cea59fb28c3e982d1f86427015e76f (patch)
tree5d13d4c2e42851d21992bbc5c483f02e6aaac106
parent53b0978842738b0c8753f2e8623d524d9922106f (diff)
downloadFreeBSD-src-4f906aab35cea59fb28c3e982d1f86427015e76f.zip
FreeBSD-src-4f906aab35cea59fb28c3e982d1f86427015e76f.tar.gz
Don't unlock a timewait structure if the pointer is NULL in
tcp_timewait(). This corrects a bug (or lack of fixing of a bug) in tcp_input.c:1.295. Submitted by: Kazuaki Oda <kaakun at highway dot ne dot jp> MFC after: 3 months
-rw-r--r--sys/netinet/tcp_input.c3
-rw-r--r--sys/netinet/tcp_reass.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index ad94e76..0532f71 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -3272,7 +3272,8 @@ tcp_timewait(tw, to, th, m, tlen)
return (0);
drop:
- INP_UNLOCK(tw->tw_inpcb);
+ if (tw != NULL)
+ INP_UNLOCK(tw->tw_inpcb);
m_freem(m);
return (0);
}
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index ad94e76..0532f71 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -3272,7 +3272,8 @@ tcp_timewait(tw, to, th, m, tlen)
return (0);
drop:
- INP_UNLOCK(tw->tw_inpcb);
+ if (tw != NULL)
+ INP_UNLOCK(tw->tw_inpcb);
m_freem(m);
return (0);
}
OpenPOWER on IntegriCloud