Skip to content

Commit 7900713

Browse files
fr0st61tedavem330
authored andcommitted
net/ncsi: change from ndo_set_mac_address to dev_set_mac_address
Change ndo_set_mac_address to dev_set_mac_address because dev_set_mac_address provides a way to notify network layer about MAC change. In other case, services may not aware about MAC change and keep using old one which set from network adapter driver. As example, DHCP client from systemd do not update MAC address without notification from net subsystem which leads to the problem with acquiring the right address from DHCP server. Fixes: cb10c7c ("net/ncsi: Add NCSI Broadcom OEM command") Cc: [email protected] # v6.0+ 2f38e84 net/ncsi: make one oem_gma function for all mfr id Signed-off-by: Paul Fertser <[email protected]> Signed-off-by: Ivan Mikhaylov <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 74b449b commit 7900713

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/ncsi/ncsi-rsp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id)
616616
{
617617
struct ncsi_dev_priv *ndp = nr->ndp;
618618
struct net_device *ndev = ndp->ndev.dev;
619-
const struct net_device_ops *ops = ndev->netdev_ops;
620619
struct ncsi_rsp_oem_pkt *rsp;
621620
struct sockaddr saddr;
622621
u32 mac_addr_off = 0;
@@ -643,7 +642,9 @@ static int ncsi_rsp_handler_oem_gma(struct ncsi_request *nr, int mfr_id)
643642
/* Set the flag for GMA command which should only be called once */
644643
ndp->gma_flag = 1;
645644

646-
ret = ops->ndo_set_mac_address(ndev, &saddr);
645+
rtnl_lock();
646+
ret = dev_set_mac_address(ndev, &saddr, NULL);
647+
rtnl_unlock();
647648
if (ret < 0)
648649
netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n");
649650

0 commit comments

Comments
 (0)