summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-08-01 03:54:43 +0000
committerrwatson <rwatson@FreeBSD.org>2002-08-01 03:54:43 +0000
commit00b9d17af80c536ef3f13148fdec855331b41dfb (patch)
treebec9fa3de914039bc5716d0495afd94bc0e9dfe7
parent41180c5da4c85b05452d6c0d9c8ecd9b923c6c5b (diff)
downloadFreeBSD-src-00b9d17af80c536ef3f13148fdec855331b41dfb.zip
FreeBSD-src-00b9d17af80c536ef3f13148fdec855331b41dfb.tar.gz
Document the undocumented assumption that at least one of the PCB
pointer and incoming mbuf pointer will be non-NULL in tcp_respond(). This is relied on by the MAC code for correctness, as well as existing code. Obtained from: TrustedBSD PRoject Sponsored by: DARPA, NAI Labs
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/netinet/tcp_timewait.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index f960fc4..fb6bd8be 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -347,6 +347,8 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags)
#endif /* INET6 */
int ipflags = 0;
+ KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL"));
+
#ifdef INET6
isipv6 = IP_VHL_V(((struct ip *)ipgen)->ip_vhl) == 6;
ip6 = ipgen;
diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c
index f960fc4..fb6bd8be 100644
--- a/sys/netinet/tcp_timewait.c
+++ b/sys/netinet/tcp_timewait.c
@@ -347,6 +347,8 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags)
#endif /* INET6 */
int ipflags = 0;
+ KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL"));
+
#ifdef INET6
isipv6 = IP_VHL_V(((struct ip *)ipgen)->ip_vhl) == 6;
ip6 = ipgen;
OpenPOWER on IntegriCloud