Skip to contentSkip to conversation

net: vrf: Fix operation not supported when set vrf mac

PATCH In review linmiaohe 3 participants 5 messages Apr 20, 2019 – Apr 25, 2019

Subsystems (3)
lore
Share & tools
lore

linmiaohe

author
#0 lore raw

PATCH 1/1 net: vrf: Fix operation not supported when set vrf mac

From: Miaohe Lin <[email protected]>

Vrf device is not able to change mac address now because lack of ndo_set_mac_address. Complete this in case some apps need to do this.

---
 drivers/net/vrf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/vrf.c +2 -0
index cd15c32b2e43..9ee4d7402ca2 100644
@@ -875,6 +875,7 @@ static const struct net_device_ops vrf_netdev_ops = {
 	.ndo_init		= vrf_dev_init,
 	.ndo_uninit		= vrf_dev_uninit,
 	.ndo_start_xmit		= vrf_xmit,
+	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_get_stats64	= vrf_get_stats64,
 	.ndo_add_slave		= vrf_add_slave,
 	.ndo_del_slave		= vrf_del_slave,
@@ -1274,6 +1275,7 @@ static void vrf_setup(struct net_device *dev)
 	/* default to no qdisc; user can add if desired */
 	dev->priv_flags |= IFF_NO_QUEUE;
 	dev->priv_flags |= IFF_NO_RX_HANDLER;
+	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
 	/* VRF devices do not care about MTU, but if the MTU is set
 	 * too low then the ipv4 and ipv6 protocols are disabled
Signature · 1 line
2.19.1
#1 lore raw
Quoted 6 lines · linmiaohe

From: Miaohe Lin <[email protected]>

Vrf device is not able to change mac address now because lack of ndo_set_mac_address. Complete this in case some apps need to do this.

mac on a VRF device is irrelevant so what is the point of allowing apps to change it?

author
#2 lore raw
Quoted 12 lines · David Ahern
Quoted 6 lines · linmiaohe

From: Miaohe Lin <[email protected]>

Vrf device is not able to change mac address now because lack of ndo_set_mac_address. Complete this in case some apps need to do this.

mac on a VRF device is irrelevant so what is the point of allowing apps to change it?

Sure, mac on a VRF device is irrelevant. There is no point of allowing apps to change it, but someone around complains about it. So let's just ignore the voice of the complaining.

maintainer
#3 lore raw
In reply to linmiaohe

From: linmiaohe <[email protected]>
Date: Sat, 20 Apr 2019 12:09:39 +0800

Quoted 8 lines

From: Miaohe Lin <[email protected]>

Vrf device is not able to change mac address now because lack of ndo_set_mac_address. Complete this in case some apps need to do this.

It seems useless, but this change is pretty much harmless so I'll apply it.

Thanks.

author
#4 lore raw
Quoted 12 lines · David Miller

From: linmiaohe <[email protected]>
Date: Sat, 20 Apr 2019 12:09:39 +0800

Quoted 8 lines

From: Miaohe Lin <[email protected]>

Vrf device is not able to change mac address now because lack of ndo_set_mac_address. Complete this in case some apps need to do this.

Quoted 7 lines

It seems useless, but this change is pretty much harmless so I'll apply it.

Thanks.

.

That's very nice of you. Thanks a lot.