flow_dissector: Fix MPLS entropy label handling in flow dissector
authorTom Herbert <tom@herbertland.com>
Fri, 12 Jun 2015 16:01:05 +0000 (09:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Jun 2015 21:24:27 +0000 (14:24 -0700)
Need to shift after masking to get label value for comparison.

Fixes: b3baa0fbd02a1a9d493d8 ("mpls: Add MPLS entropy label in flow_keys")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/flow_dissector.c

index 77e22e4fc89826507b5f2ce197d62b4c1dff1b0e..1818cdcaa9b9be2e761d0bb0cae64e982e62b180 100644 (file)
@@ -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,