bonding: fix error messages in bond_do_fail_over_mac

Passing the bond name again to debug output when referencing slave is wrong.
We're trying to set the bond's MAC to that of the new_active slave, so adjust
the error message slightly and pass in the slave's name, not the bond's.
Then we're trying to set the MAC on the old active slave, but putting the
new active slave's name in the output. While we're at it, clarify the
error messages so you know which one actually triggered.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: netdev@vger.kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jarod Wilson 2019-06-07 10:59:27 -04:00 committed by David S. Miller
parent 75466dce4d
commit f43b653026
1 changed files with 5 additions and 5 deletions

View File

@ -661,8 +661,8 @@ static void bond_do_fail_over_mac(struct bonding *bond,
if (new_active) { if (new_active) {
rv = bond_set_dev_addr(bond->dev, new_active->dev); rv = bond_set_dev_addr(bond->dev, new_active->dev);
if (rv) if (rv)
netdev_err(bond->dev, "Error %d setting MAC of slave %s\n", netdev_err(bond->dev, "Error %d setting bond MAC from slave %s\n",
-rv, bond->dev->name); -rv, new_active->dev->name);
} }
break; break;
case BOND_FOM_FOLLOW: case BOND_FOM_FOLLOW:
@ -692,7 +692,7 @@ static void bond_do_fail_over_mac(struct bonding *bond,
rv = dev_set_mac_address(new_active->dev, rv = dev_set_mac_address(new_active->dev,
(struct sockaddr *)&ss, NULL); (struct sockaddr *)&ss, NULL);
if (rv) { if (rv) {
netdev_err(bond->dev, "Error %d setting MAC of slave %s\n", netdev_err(bond->dev, "Error %d setting MAC of new active slave %s\n",
-rv, new_active->dev->name); -rv, new_active->dev->name);
goto out; goto out;
} }
@ -707,8 +707,8 @@ static void bond_do_fail_over_mac(struct bonding *bond,
rv = dev_set_mac_address(old_active->dev, rv = dev_set_mac_address(old_active->dev,
(struct sockaddr *)&ss, NULL); (struct sockaddr *)&ss, NULL);
if (rv) if (rv)
netdev_err(bond->dev, "Error %d setting MAC of slave %s\n", netdev_err(bond->dev, "Error %d setting MAC of old active slave %s\n",
-rv, new_active->dev->name); -rv, old_active->dev->name);
out: out:
break; break;
default: default: