summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2011-06-20 07:07:18 +0000
committerbz <bz@FreeBSD.org>2011-06-20 07:07:18 +0000
commit9185689916b66441c4139d598975c6e6a773b5bc (patch)
tree64056eceff3e7850557c43b7baa02731d957354e /sys/netinet/tcp_output.c
parent045528c230abc49a8b1b1393bc45366a302fa5bf (diff)
downloadFreeBSD-src-9185689916b66441c4139d598975c6e6a773b5bc.zip
FreeBSD-src-9185689916b66441c4139d598975c6e6a773b5bc.tar.gz
Fix a KASSERT from r212803 to check the correct length also in case of
IPsec being compiled in and used. Improve reporting by adding the length fields to the panic message, so that we would have some immediate debugging hints. Discussed with: jhb
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 32cb81e..4542ac5 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -1102,8 +1102,15 @@ send:
m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen;
}
+#ifdef IPSEC
+ KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL),
+ ("%s: mbuf chain shorter than expected: %ld + %u + %u - %u != %u",
+ __func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL)));
+#else
KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL),
- ("%s: mbuf chain shorter than expected", __func__));
+ ("%s: mbuf chain shorter than expected: %ld + %u + %u != %u",
+ __func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
+#endif
/*
* In transmit state, time the transmission and arrange for
OpenPOWER on IntegriCloud