From 6a5252c5e103d15fd7485104525a97622ba8397d Mon Sep 17 00:00:00 2001 From: sumikawa Date: Mon, 29 Oct 2001 07:55:57 +0000 Subject: Fix fragmented packet handling. Obtained from: KAME MFC after: 3 weeks --- sys/netinet6/ip6_fw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/netinet6') diff --git a/sys/netinet6/ip6_fw.c b/sys/netinet6/ip6_fw.c index c932539..5f60716 100644 --- a/sys/netinet6/ip6_fw.c +++ b/sys/netinet6/ip6_fw.c @@ -231,11 +231,11 @@ ip6opts_match(struct ip6_hdr **pip6, struct ip6_fw *f, struct mbuf **m, switch(*nxt) { case IPPROTO_FRAGMENT: - if ((*m)->m_len < *off + sizeof(struct ip6_frag)) { + if ((*m)->m_len >= *off + sizeof(struct ip6_frag)) { struct ip6_frag *ip6f; ip6f = (struct ip6_frag *) ((caddr_t)ip6 + *off); - *offset = ip6f->ip6f_offlg | IP6F_OFF_MASK; + *offset = ip6f->ip6f_offlg & IP6F_OFF_MASK; } opts &= ~IPV6_FW_IP6OPT_FRAG; nopts &= ~IPV6_FW_IP6OPT_FRAG; -- cgit v1.1