From: Tom Herbert Date: Fri, 12 Jun 2015 16:01:05 +0000 (-0700) Subject: flow_dissector: Fix MPLS entropy label handling in flow dissector X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=611d23c559a328ca3f84ac120c02d5a9f88c08f5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git flow_dissector: Fix MPLS entropy label handling in flow dissector 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 Signed-off-by: Tom Herbert Signed-off-by: David S. Miller --- diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 77e22e4fc898..1818cdcaa9b9 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,