summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>1999-12-06 22:56:03 +0000
committerangelos <angelos@openbsd.org>1999-12-06 22:56:03 +0000
commit7136b6a7f641ba594eb86b9a2e797a32492584b9 (patch)
tree9adcf285168fc2783bd368a6de3b7b4c2a1024bd
parentDon't do m_adj() if it's not really needed (minor optimization, (diff)
downloadwireguard-openbsd-7136b6a7f641ba594eb86b9a2e797a32492584b9.tar.xz
wireguard-openbsd-7136b6a7f641ba594eb86b9a2e797a32492584b9.zip
Some preliminiries to AH revamping (similar to ESP)...
-rw-r--r--sys/netinet/ip_ah.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 1735573970c..2b0ce925dfa 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.27 1999/12/06 07:14:35 angelos Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.28 1999/12/06 22:56:03 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -203,7 +203,17 @@ ah_input(m, va_alist)
return;
}
+ if ((m = m_pullup(m, ipn.ip_hl << 2)) == 0)
+ {
+ ahstat.esps_hdrops++;
+ return;
+ }
+
ipo = mtod(m, struct ip *);
+ ipo->ip_len = htons(m->m_pkthdr.len);
+ ipo->ip_sum = 0;
+ ipo->ip_sum = in_cksum(m, ipo->ip_hl << 2);
+
if (ipo->ip_p == IPPROTO_IPIP) /* IP-in-IP encapsulation */
{
/* ipn will now contain the inner IP header */