Skip to content

Commit

Permalink
flow_dissector: Support IPv6 fragment header
Browse files Browse the repository at this point in the history
Parse NEXTHDR_FRAGMENT. When seen account for it in the fragment bits of
key_control. Also, check if first fragment should be parsed.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tom Herbert authored and David S. Miller committed Sep 1, 2015
1 parent 807e165 commit b840f28
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,31 @@ bool __skb_flow_dissect(const struct sk_buff *skb,

goto ip_proto_again;
}
case NEXTHDR_FRAGMENT: {
struct frag_hdr _fh, *fh;

if (proto != htons(ETH_P_IPV6))
break;

fh = __skb_header_pointer(skb, nhoff, sizeof(_fh),
data, hlen, &_fh);

if (!fh)
goto out_bad;

key_control->is_fragment = 1;

nhoff += sizeof(_fh);

if (!(fh->frag_off & htons(IP6_OFFSET))) {
key_control->first_frag = 1;
if (flags & FLOW_DISSECTOR_F_PARSE_1ST_FRAG) {
ip_proto = fh->nexthdr;
goto ip_proto_again;
}
}
goto out_good;
}
case IPPROTO_IPIP:
proto = htons(ETH_P_IP);
goto ip;
Expand Down

0 comments on commit b840f28

Please sign in to comment.