Patch "net: dsa: tag_sja1105: fix MAC DA patching from meta frames" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: dsa: tag_sja1105: fix MAC DA patching from meta frames

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-dsa-tag_sja1105-fix-mac-da-patching-from-meta-fr.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 12c6d660a05c41a708a70408521a91b7812f553f
Author: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Date:   Tue Jul 4 01:05:44 2023 +0300

    net: dsa: tag_sja1105: fix MAC DA patching from meta frames
    
    [ Upstream commit 1dcf6efd5f0c1f4496b3ef7ec5a7db104a53b38c ]
    
    The SJA1105 manual says that at offset 4 into the meta frame payload we
    have "MAC destination byte 2" and at offset 5 we have "MAC destination
    byte 1". These are counted from the LSB, so byte 1 is h_dest[ETH_HLEN-2]
    aka h_dest[4] and byte 2 is h_dest[ETH_HLEN-3] aka h_dest[3].
    
    The sja1105_meta_unpack() function decodes these the other way around,
    so a frame with MAC DA 01:80:c2:11:22:33 is received by the network
    stack as having 01:80:c2:22:11:33.
    
    Fixes: e53e18a6fe4d ("net: dsa: sja1105: Receive and decode meta frames")
    Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/dsa/tag_sja1105.c b/net/dsa/tag_sja1105.c
index 50496013cdb7f..07876160edd2b 100644
--- a/net/dsa/tag_sja1105.c
+++ b/net/dsa/tag_sja1105.c
@@ -48,8 +48,8 @@ static void sja1105_meta_unpack(const struct sk_buff *skb,
 	 * a unified unpacking command for both device series.
 	 */
 	packing(buf,     &meta->tstamp,     31, 0, 4, UNPACK, 0);
-	packing(buf + 4, &meta->dmac_byte_4, 7, 0, 1, UNPACK, 0);
-	packing(buf + 5, &meta->dmac_byte_3, 7, 0, 1, UNPACK, 0);
+	packing(buf + 4, &meta->dmac_byte_3, 7, 0, 1, UNPACK, 0);
+	packing(buf + 5, &meta->dmac_byte_4, 7, 0, 1, UNPACK, 0);
 	packing(buf + 6, &meta->source_port, 7, 0, 1, UNPACK, 0);
 	packing(buf + 7, &meta->switch_id,   7, 0, 1, UNPACK, 0);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux