summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-08-03 08:21:00 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-08-03 08:21:00 +0000
commitc570baee378151017405d857b809a22366873ae3 (patch)
treebf4a0f84d6dd5b183a7504bac181c8eb021b3533 /sys
parentd08a71cde627334e27da3636b83185df6b646c1c (diff)
Careful with ip_off
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/ip_ah.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 2cfc5cf60fc..ce448dfa7c9 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.42 2000/06/20 04:19:10 itojun Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.43 2000/08/03 08:20:59 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -233,12 +233,19 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out)
ip->ip_len += skip;
HTONS(ip->ip_len);
HTONS(ip->ip_id);
- }
- if ((alg == CRYPTO_MD5_KPDK) || (alg == CRYPTO_SHA1_KPDK))
- ip->ip_off = htons(ip->ip_off & IP_DF);
- else
- ip->ip_off = 0;
+ if ((alg == CRYPTO_MD5_KPDK) || (alg == CRYPTO_SHA1_KPDK))
+ ip->ip_off = htons(ip->ip_off & IP_DF);
+ else
+ ip->ip_off = 0;
+ }
+ else
+ {
+ if ((alg == CRYPTO_MD5_KPDK) || (alg == CRYPTO_SHA1_KPDK))
+ ip->ip_off = htons(ntohs(ip->ip_off) & IP_DF);
+ else
+ ip->ip_off = 0;
+ }
ptr = mtod(m, unsigned char *) + sizeof(struct ip);