summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-09-01 19:24:29 +0300
committerDavid S. Miller <davem@davemloft.net>2015-09-02 01:06:22 +0300
commitb840f28b908da0239c8c5d9c8cae362ad21cda97 (patch)
tree66608d91eccb337df6e81f19c5946b5ad778cd44
parent807e165dc44fd93f9d378f861f0540a158d7343a (diff)
downloadlinux-b840f28b908da0239c8c5d9c8cae362ad21cda97.tar.xz
flow_dissector: Support IPv6 fragment header
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>
-rw-r--r--net/core/flow_dissector.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 7536a4669029..907de2f68b1f 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -409,6 +409,31 @@ ip_proto_again:
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;