diff options
author | Tom Herbert <tom@herbertland.com> | 2015-06-12 09:01:06 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-12 14:24:28 -0700 |
commit | 6a74fcf426f51aaa569f0b973d10ac20468df238 (patch) | |
tree | 9d1b8fe5943f1be0e1244e68d963240571131e7a /net | |
parent | 611d23c559a328ca3f84ac120c02d5a9f88c08f5 (diff) | |
download | linux-6a74fcf426f51aaa569f0b973d10ac20468df238.tar.bz2 |
flow_dissector: add support for dst, hop-by-hop and routing ext hdrs
If dst, hop-by-hop or routing extension headers are present determine
length of the options and skip over them in flow dissection.
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/flow_dissector.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 1818cdcaa9b9..22e4dffa0c8b 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -327,6 +327,7 @@ mpls: return false; } +ip_proto_again: switch (ip_proto) { case IPPROTO_GRE: { struct gre_hdr { @@ -383,6 +384,22 @@ mpls: } goto again; } + case NEXTHDR_HOP: + case NEXTHDR_ROUTING: + case NEXTHDR_DEST: { + u8 _opthdr[2], *opthdr; + + if (proto != htons(ETH_P_IPV6)) + break; + + opthdr = __skb_header_pointer(skb, nhoff, sizeof(_opthdr), + data, hlen, &_opthdr); + + ip_proto = _opthdr[0]; + nhoff += (_opthdr[1] + 1) << 3; + + goto ip_proto_again; + } case IPPROTO_IPIP: proto = htons(ETH_P_IP); goto ip; |