From 00b9d17af80c536ef3f13148fdec855331b41dfb Mon Sep 17 00:00:00 2001 From: rwatson Date: Thu, 1 Aug 2002 03:54:43 +0000 Subject: 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 --- sys/netinet/tcp_subr.c | 2 ++ sys/netinet/tcp_timewait.c | 2 ++ 2 files changed, 4 insertions(+) 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; -- cgit v1.1