diff options
author | ae <ae@FreeBSD.org> | 2018-01-24 19:06:44 +0000 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2018-01-28 14:18:37 -0200 |
commit | f2f301b66462c68f30ecef1a16fafbff8ce2eab2 (patch) | |
tree | a4b1ad0588331363552e42534f748bdeda06e15e /sys/netipsec/xform_ah.c | |
parent | 68f86c1364d379dc8bc306a57a2d05b39f6e52c0 (diff) | |
download | FreeBSD-src-f2f301b66462c68f30ecef1a16fafbff8ce2eab2.zip FreeBSD-src-f2f301b66462c68f30ecef1a16fafbff8ce2eab2.tar.gz |
Merge revision 1.35 from NetBSD:
fix pointer/offset mistakes in handling of IPv4 options
Reported by: Maxime Villard <maxv at NetBSD.org>
MFC after: 1 week
(cherry picked from commit 733b094ecd54f727d08d8b4ac02aaca48db98ba7)
Diffstat (limited to 'sys/netipsec/xform_ah.c')
-rw-r--r-- | sys/netipsec/xform_ah.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netipsec/xform_ah.c b/sys/netipsec/xform_ah.c index fada7b7..577be37 100644 --- a/sys/netipsec/xform_ah.c +++ b/sys/netipsec/xform_ah.c @@ -293,7 +293,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) else ip->ip_off = htons(0); - ptr = mtod(m, unsigned char *) + sizeof(struct ip); + ptr = mtod(m, unsigned char *); /* IPv4 option processing */ for (off = sizeof(struct ip); off < skip;) { @@ -374,7 +374,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) /* Zeroize all other options. */ count = ptr[off + 1]; - bcopy(ipseczeroes, ptr, count); + bcopy(ipseczeroes, ptr + off, count); off += count; break; } |