Commit 1c15b05b authored by Fernando Fernandez Mancera's avatar Fernando Fernandez Mancera Committed by Jakub Kicinski

bonding: fix ad_actor_system option setting to default

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: 171a42c3 ("bonding: add netlink support for sys prio, actor sys mac, and port key")
Signed-off-by: default avatarFernando Fernandez Mancera <ffmancera@riseup.net>
Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20211221111345.2462-1-ffmancera@riseup.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ac8c58f5
...@@ -196,11 +196,12 @@ ad_actor_sys_prio ...@@ -196,11 +196,12 @@ ad_actor_sys_prio
ad_actor_system ad_actor_system
In an AD system, this specifies the mac-address for the actor in In an AD system, this specifies the mac-address for the actor in
protocol packet exchanges (LACPDUs). The value cannot be NULL or protocol packet exchanges (LACPDUs). The value cannot be a multicast
multicast. It is preferred to have the local-admin bit set for this address. If the all-zeroes MAC is specified, bonding will internally
mac but driver does not enforce it. If the value is not given then use the MAC of the bond itself. It is preferred to have the
system defaults to using the masters' mac address as actors' system local-admin bit set for this mac but driver does not enforce it. If
address. 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 This parameter has effect only in 802.3ad mode and is available through
SysFs interface. SysFs interface.
......
...@@ -1526,7 +1526,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond, ...@@ -1526,7 +1526,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
mac = (u8 *)&newval->value; mac = (u8 *)&newval->value;
} }
if (!is_valid_ether_addr(mac)) if (is_multicast_ether_addr(mac))
goto err; goto err;
netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac); netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment