diff mbox series

[iwl-net,v1,1/2] drivers/net/bonding/bond_3ad: Use updated MAC address for lacpdu packets

Message ID 20230516134447.193511-2-mateusz.palczewski@intel.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Fix for bond 802.3ad mode with VFs | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers fail 1 blamed authors not CCed: joe@perches.com; 1 maintainers not CCed: joe@perches.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Mateusz Palczewski May 16, 2023, 1:44 p.m. UTC
From: Sebastian Basierski <sebastianx.basierski@intel.com>

After changing VFs MAC address, bonding driver shouldn't use
the old address. Otherwise lapcdu packets will have set wrong
source MAC address.

Fixes: ada0f8633c5b ("bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)")
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
---
 drivers/net/bonding/bond_3ad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jay Vosburgh May 16, 2023, 3:02 p.m. UTC | #1
Mateusz Palczewski <mateusz.palczewski@intel.com> wrote:

>From: Sebastian Basierski <sebastianx.basierski@intel.com>
>
>After changing VFs MAC address, bonding driver shouldn't use
>the old address. Otherwise lapcdu packets will have set wrong
>source MAC address.

	This patch is incorrect, the existing code is behaving
correctly.

	Bonding uses the original device MAC address deliberately, as
IEEE 802.1AX-2014 6.2.1.i requires that each port utilize a MAC address
that is "unique over the LAG" as the source address for LACPDUs.

	As bonding sets all ports of the bond to the same MAC (so that
non-control traffic uses the same source MAC per 802.1AX 6.2.1.j), this
change would cause every port of the bond to use a single MAC address
for the LACPDU source address, thus violating 802.1AX.

	-J

>Fixes: ada0f8633c5b ("bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)")
>Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
>Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
>---
> drivers/net/bonding/bond_3ad.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index c99ffe6c683a..b5202af79f20 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -869,10 +869,10 @@ static int ad_lacpdu_send(struct port *port)
> 	lacpdu_header = skb_put(skb, length);
> 
> 	ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr);
>-	/* Note: source address is set to be the member's PERMANENT address,
>+	/* Note: source address is set to be the member's CURRENT address,
> 	 * because we use it to identify loopback lacpdus in receive.
> 	 */
>-	ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr);
>+	ether_addr_copy(lacpdu_header->hdr.h_source, slave->dev->dev_addr);
> 	lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU;
> 
> 	lacpdu_header->lacpdu = port->lacpdu;
>-- 
>2.31.1

---
	-Jay Vosburgh, jay.vosburgh@canonical.com
diff mbox series

Patch

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index c99ffe6c683a..b5202af79f20 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -869,10 +869,10 @@  static int ad_lacpdu_send(struct port *port)
 	lacpdu_header = skb_put(skb, length);
 
 	ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr);
-	/* Note: source address is set to be the member's PERMANENT address,
+	/* Note: source address is set to be the member's CURRENT address,
 	 * because we use it to identify loopback lacpdus in receive.
 	 */
-	ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr);
+	ether_addr_copy(lacpdu_header->hdr.h_source, slave->dev->dev_addr);
 	lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU;
 
 	lacpdu_header->lacpdu = port->lacpdu;