netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] vxlan: fix ethernet address initialization
@ 2016-04-28 10:04 Nicolas Dichtel
  2016-04-28 10:28 ` Jiri Benc
  2016-04-28 15:07 ` Nicolas Dichtel
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Dichtel @ 2016-04-28 10:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel, Jiri Benc

Since commit 0c867c9bf84c, when the user specifies an ethernet address with
IFLA_ADDRESS, it's overridden by vxlan_ether_setup() (rtnl_link_ops->setup
is called in rtnetlink.c before handling IFLA_ADDRESS).

To test it:
ip link add name vxlan1 address de:ad:de:4c:0f:c2 type vxlan id 1 group 239.0.0.10 dev eth0

CC: Jiri Benc <jbenc@redhat.com>
Fixes: 0c867c9bf84c ("vxlan: move Ethernet initialization to a separate function")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 drivers/net/vxlan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 6fb93b57a724..d454c7e7d16e 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2592,7 +2592,8 @@ static void vxlan_setup(struct net_device *dev)
 
 static void vxlan_ether_setup(struct net_device *dev)
 {
-	eth_hw_addr_random(dev);
+	if (!is_valid_ether_addr(dev->dev_addr))
+		eth_hw_addr_random(dev);
 	ether_setup(dev);
 	dev->priv_flags &= ~IFF_TX_SKB_SHARING;
 	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
-- 
2.4.2

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

* Re: [PATCH net-next] vxlan: fix ethernet address initialization
  2016-04-28 10:04 [PATCH net-next] vxlan: fix ethernet address initialization Nicolas Dichtel
@ 2016-04-28 10:28 ` Jiri Benc
  2016-04-28 15:07 ` Nicolas Dichtel
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Benc @ 2016-04-28 10:28 UTC (permalink / raw)
  To: Nicolas Dichtel; +Cc: davem, netdev

On Thu, 28 Apr 2016 12:04:16 +0200, Nicolas Dichtel wrote:
> Since commit 0c867c9bf84c, when the user specifies an ethernet address with
> IFLA_ADDRESS, it's overridden by vxlan_ether_setup() (rtnl_link_ops->setup
> is called in rtnetlink.c before handling IFLA_ADDRESS).
> 
> To test it:
> ip link add name vxlan1 address de:ad:de:4c:0f:c2 type vxlan id 1 group 239.0.0.10 dev eth0

Good catch, Nicholas. I wrote a lnst recipe to test tons of
combinations of vxlan settings but did not think about including also
link parameters :-(

This affects not only IFLA_ADDRESS but also IFLA_MTU, IFLA_BROADCAST
and IFLA_TXQLEN. I'll try to solve all of these.

Thanks for catching this.

 Jiri

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

* Re: [PATCH net-next] vxlan: fix ethernet address initialization
  2016-04-28 10:04 [PATCH net-next] vxlan: fix ethernet address initialization Nicolas Dichtel
  2016-04-28 10:28 ` Jiri Benc
@ 2016-04-28 15:07 ` Nicolas Dichtel
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dichtel @ 2016-04-28 15:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, Jiri Benc

Le 28/04/2016 12:04, Nicolas Dichtel a écrit :
> Since commit 0c867c9bf84c, when the user specifies an ethernet address with
> IFLA_ADDRESS, it's overridden by vxlan_ether_setup() (rtnl_link_ops->setup
> is called in rtnetlink.c before handling IFLA_ADDRESS).
> 
> To test it:
> ip link add name vxlan1 address de:ad:de:4c:0f:c2 type vxlan id 1 group 239.0.0.10 dev eth0
> 
> CC: Jiri Benc <jbenc@redhat.com>
> Fixes: 0c867c9bf84c ("vxlan: move Ethernet initialization to a separate function")
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
David, please drop this patch. Jiri has sent a better fix.


Thank you,
Nicolas

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

end of thread, other threads:[~2016-04-28 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28 10:04 [PATCH net-next] vxlan: fix ethernet address initialization Nicolas Dichtel
2016-04-28 10:28 ` Jiri Benc
2016-04-28 15:07 ` Nicolas Dichtel

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).