qeth: set new mac even if old mac is gone

If the set_mac_address() function of qeth is invoked, qeth deletes
the old mac address first on OSA. Only if deletion returns
successfully the new mac address is set on OSA. Deletion may return
with a return value "MAC not found on OSA". In this case qeth
should continue setting the new mac address.

When the OSA cable is pulled, OSA forgets any set mac address. If
the OSA network interface acts as a slave to a bonding master
interface, bonding can invoke the set_mac_address function for
failover purposes and depends on successful setting of the new mac
address even though the old mac address could no longer be deleted.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ursula Braun 2012-11-12 23:05:17 +00:00 коммит произвёл David S. Miller
Родитель a134884ac0
Коммит 7702745b15
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -679,7 +679,7 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
return -ERESTARTSYS; return -ERESTARTSYS;
} }
rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]); rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]);
if (!rc) if (!rc || (rc == IPA_RC_L2_MAC_NOT_FOUND))
rc = qeth_l2_send_setmac(card, addr->sa_data); rc = qeth_l2_send_setmac(card, addr->sa_data);
return rc ? -EINVAL : 0; return rc ? -EINVAL : 0;
} }