Skip to content

Commit

Permalink
dsa: tag_dsa: Fix mask for trunked packets
Browse files Browse the repository at this point in the history
commit b44d52a upstream.

A packet received on a trunk will have bit 2 set in Forward DSA tagged
frame. Bit 1 can be either 0 or 1 and is otherwise undefined and bit 0
indicates the frame CFI. Masking with 7 thus results in frames as
being identified as being from a trunk when in fact they are not. Fix
the mask to just look at bit 2.

Fixes: 5b60dad ("net: dsa: tag_dsa: Support reception of packets from LAG devices")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andrew Lunn authored and Greg Kroah-Hartman committed Oct 13, 2021
1 parent 5dc24f3 commit 58f0e59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/dsa/tag_dsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev,
case DSA_CMD_FORWARD:
skb->offload_fwd_mark = 1;

trunk = !!(dsa_header[1] & 7);
trunk = !!(dsa_header[1] & 4);
break;

case DSA_CMD_TO_CPU:
Expand Down

0 comments on commit 58f0e59

Please sign in to comment.