]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bonding: fix ad_actor_system option setting to default
authorFernando Fernandez Mancera <ffmancera@riseup.net>
Tue, 21 Dec 2021 11:13:45 +0000 (12:13 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:42 +0000 (09:49 +0100)
BugLink: https://bugs.launchpad.net/bugs/1956305
[ Upstream commit 1c15b05baea71a5ff98235783e3e4ad227760876 ]

When 802.3ad bond mode is configured the ad_actor_system option is set to
"00:00:00:00:00:00". But when trying to set the all-zeroes MAC as actors'
system address it was failing with EINVAL.

An all-zeroes ethernet address is valid, only multicast addresses are not
valid values.

Fixes: 171a42c38c6e ("bonding: add netlink support for sys prio, actor sys mac, and port key")
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20211221111345.2462-1-ffmancera@riseup.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Documentation/networking/bonding.rst
drivers/net/bonding/bond_options.c

index 31cfd7d674a6cd767e31e0feb36e3fd1f4b127db..c0a789b0080635afdd208dc7600a9811f700347d 100644 (file)
@@ -196,11 +196,12 @@ ad_actor_sys_prio
 ad_actor_system
 
        In an AD system, this specifies the mac-address for the actor in
-       protocol packet exchanges (LACPDUs). The value cannot be NULL or
-       multicast. It is preferred to have the local-admin bit set for this
-       mac but driver does not enforce it. If the value is not given then
-       system defaults to using the masters' mac address as actors' system
-       address.
+       protocol packet exchanges (LACPDUs). The value cannot be a multicast
+       address. If the all-zeroes MAC is specified, bonding will internally
+       use the MAC of the bond itself. It is preferred to have the
+       local-admin bit set for this mac but driver does not enforce it. If
+       the value is not given then system defaults to using the masters'
+       mac address as actors' system address.
 
        This parameter has effect only in 802.3ad mode and is available through
        SysFs interface.
index a8fde3bc458f6c360252f0a3e0648e533936524e..b93337b5a7211f0361eb05ef81f503a5440272aa 100644 (file)
@@ -1526,7 +1526,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
                mac = (u8 *)&newval->value;
        }
 
-       if (!is_valid_ether_addr(mac))
+       if (is_multicast_ether_addr(mac))
                goto err;
 
        netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);