Skip to content

Commit

Permalink
bonding: fix ad_actor_system option setting to default
Browse files Browse the repository at this point in the history
[ Upstream commit 1c15b05 ]

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: 171a42c ("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>
  • Loading branch information
ffmancera authored and gregkh committed Dec 29, 2021
1 parent 6809da5 commit c6d2754
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Documentation/networking/bonding.rst
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_options.c
Expand Up @@ -1466,7 +1466,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);
Expand Down

0 comments on commit c6d2754

Please sign in to comment.