summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-06-12 14:24:28 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-12 14:24:28 -0700
commitea70477099e2b2350ac3bdda0ddaefb6c68970dd (patch)
tree9d1b8fe5943f1be0e1244e68d963240571131e7a
parentb60f2f3d65de3f3e9e63855e5f5070a3fedcccba (diff)
parent6a74fcf426f51aaa569f0b973d10ac20468df238 (diff)
Merge branch 'flow_dissector-next'
Tom Herbert says: ==================== flow_dissector: Fix MPLS parsing and add ext hdr support Need to shift label. Added parsing of dst, hop-by-hop, and routing extension headers. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/flow_dissector.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 77e22e4fc898..22e4dffa0c8b 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -299,8 +299,8 @@ mpls:
if (!hdr)
return false;
- if ((ntohl(hdr[0].entry) & MPLS_LS_LABEL_MASK) ==
- MPLS_LABEL_ENTROPY) {
+ if ((ntohl(hdr[0].entry) & MPLS_LS_LABEL_MASK) >>
+ MPLS_LS_LABEL_SHIFT == MPLS_LABEL_ENTROPY) {
if (skb_flow_dissector_uses_key(flow_dissector,
FLOW_DISSECTOR_KEY_MPLS_ENTROPY)) {
key_keyid = skb_flow_dissector_target(flow_dissector,
@@ -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;