linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: vrf: Fix operation not supported when set vrf mac
@ 2019-04-20  4:09 linmiaohe
  2019-04-20 14:42 ` David Ahern
  2019-04-24 18:45 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: linmiaohe @ 2019-04-20  4:09 UTC (permalink / raw)
  To: dsa, shrijeet, davem, netdev, linux-kernel; +Cc: Mingfangsen

From: Miaohe Lin <linmiaohe@huawei.com>

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.

Reported-by: Hui Wang <wanghui104@huawei.com>
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 drivers/net/vrf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index cd15c32b2e43..9ee4d7402ca2 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -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
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: vrf: Fix operation not supported when set vrf mac
  2019-04-20  4:09 [PATCH] net: vrf: Fix operation not supported when set vrf mac linmiaohe
@ 2019-04-20 14:42 ` David Ahern
  2019-04-21  7:17   ` linmiaohe
  2019-04-24 18:45 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: David Ahern @ 2019-04-20 14:42 UTC (permalink / raw)
  To: linmiaohe, shrijeet, davem, netdev, linux-kernel; +Cc: Mingfangsen

On 4/19/19 10:09 PM, linmiaohe wrote:
> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> 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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: vrf: Fix operation not supported when set vrf mac
  2019-04-20 14:42 ` David Ahern
@ 2019-04-21  7:17   ` linmiaohe
  0 siblings, 0 replies; 5+ messages in thread
From: linmiaohe @ 2019-04-21  7:17 UTC (permalink / raw)
  To: David Ahern, shrijeet, davem, netdev, linux-kernel; +Cc: Mingfangsen



On 2019/4/20 22:42, David Ahern wrote:
> On 4/19/19 10:09 PM, linmiaohe wrote:
>> From: Miaohe Lin <linmiaohe@huawei.com>
>>
>> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: vrf: Fix operation not supported when set vrf mac
  2019-04-20  4:09 [PATCH] net: vrf: Fix operation not supported when set vrf mac linmiaohe
  2019-04-20 14:42 ` David Ahern
@ 2019-04-24 18:45 ` David Miller
  2019-04-25  1:41   ` linmiaohe
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2019-04-24 18:45 UTC (permalink / raw)
  To: linmiaohe; +Cc: dsa, shrijeet, netdev, linux-kernel, mingfangsen

From: linmiaohe <linmiaohe@huawei.com>
Date: Sat, 20 Apr 2019 12:09:39 +0800

> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> 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.
> 
> Reported-by: Hui Wang <wanghui104@huawei.com>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

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

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: vrf: Fix operation not supported when set vrf mac
  2019-04-24 18:45 ` David Miller
@ 2019-04-25  1:41   ` linmiaohe
  0 siblings, 0 replies; 5+ messages in thread
From: linmiaohe @ 2019-04-25  1:41 UTC (permalink / raw)
  To: David Miller; +Cc: dsa, shrijeet, netdev, linux-kernel, mingfangsen



On 2019/4/25 2:45, David Miller wrote:
> From: linmiaohe <linmiaohe@huawei.com>
> Date: Sat, 20 Apr 2019 12:09:39 +0800
> 
>> From: Miaohe Lin <linmiaohe@huawei.com>
>>
>> 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.
>>
>> Reported-by: Hui Wang <wanghui104@huawei.com>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> 
> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-25  1:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-20  4:09 [PATCH] net: vrf: Fix operation not supported when set vrf mac linmiaohe
2019-04-20 14:42 ` David Ahern
2019-04-21  7:17   ` linmiaohe
2019-04-24 18:45 ` David Miller
2019-04-25  1:41   ` linmiaohe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).