summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-25 06:14:06 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-06-25 06:14:06 +0000
commit36566f86722fa77fabda5088d4e314a45b122671 (patch)
tree30ad08c60c8843194e18bae7249440e797d70f2d
parent428cba84e069ae4233e5e0a75978d4c0b9e6bd8f (diff)
Check the length of the tag (diagnostic)
-rw-r--r--sys/netinet/ip_output.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index d84a307caf1..d4a9ee817e1 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_output.c,v 1.124 2001/06/25 06:09:42 angelos Exp $ */
+/* $OpenBSD: ip_output.c,v 1.125 2001/06/25 06:14:05 angelos Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
@@ -279,6 +279,12 @@ ip_output(m0, va_alist)
/* Do we have any pending SAs to apply ? */
mtag = m_tag_find(m, PACKET_TAG_IPSEC_PENDING_TDB, NULL);
if (mtag != NULL) {
+#ifdef DIAGNOSTIC
+ if (mtag->m_tag_len != sizeof (struct tdb_ident))
+ panic("ip_output: tag of length %d (should "
+ "be %d", mtag->m_tag_len,
+ sizeof (struct tdb_ident));
+#endif
tdbi = (struct tdb_ident *)(mtag + 1);
tdb = gettdb(tdbi->spi, &tdbi->dst, tdbi->proto);
m_tag_delete(m, mtag);