Skip to content

Commit

Permalink
flow_dissector: Fix MPLS entropy label handling in flow dissector
Browse files Browse the repository at this point in the history
Need to shift after masking to get label value for comparison.

Fixes: b3baa0f ("mpls: Add MPLS entropy label in flow_keys")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Tom Herbert <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
tomratbert authored and davem330 committed Jun 12, 2015
1 parent b60f2f3 commit 611d23c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/flow_dissector.c
Original file line number Diff line number Diff line change
@@ -299,8 +299,8 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
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,

0 comments on commit 611d23c

Please sign in to comment.