[PATCH] tun: allow setting ethernet addresss while running

Subsystems: networking drivers, the rest, tun/tap driver

STALE5019d

4 messages, 3 authors, 2012-12-12 · open the first message on its own page

[PATCH] tun: allow setting ethernet addresss while running

From: Stephen Hemminger <hidden>
Date: 2012-12-11 01:17:37

This is a pure software device, and ok with live address change.

Signed-off-by: Stephen Hemminger <redacted>
---
 drivers/net/tun.c |    1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 14a0454..2ac2164 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -849,6 +849,7 @@ static void tun_net_init(struct net_device *dev)
 		/* Ethernet TAP Device */
 		ether_setup(dev);
 		dev->priv_flags &= ~IFF_TX_SKB_SHARING;
+		dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 
 		eth_hw_addr_random(dev);
 
-- 
1.7.10.4

Re: [PATCH] tun: allow setting ethernet addresss while running

From: David Miller <davem@davemloft.net>
Date: 2012-12-11 17:50:35

From: Stephen Hemminger <redacted>
Date: Mon, 10 Dec 2012 17:16:00 -0800
This is a pure software device, and ok with live address change.

Signed-off-by: Stephen Hemminger <redacted>
Applied.

Re: [PATCH] tun: allow setting ethernet addresss while running

From: Jan Engelhardt <hidden>
Date: 2012-12-12 03:27:56

On Tuesday 2012-12-11 02:16, Stephen Hemminger wrote:
quoted hunk
This is a pure software device, and ok with live address change.
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -849,6 +849,7 @@ static void tun_net_init(struct net_device *dev)
		/* Ethernet TAP Device */
		ether_setup(dev);
		dev->priv_flags &= ~IFF_TX_SKB_SHARING;
+		dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

		eth_hw_addr_random(dev);
Would this possibly apply to L2TP devices as well?

Re: [PATCH] tun: allow setting ethernet addresss while running

From: Stephen Hemminger <hidden>
Date: 2012-12-12 16:40:15

On Wed, 12 Dec 2012 04:27:54 +0100 (CET)
Jan Engelhardt [off-list ref] wrote:
On Tuesday 2012-12-11 02:16, Stephen Hemminger wrote:
quoted
This is a pure software device, and ok with live address change.
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -849,6 +849,7 @@ static void tun_net_init(struct net_device *dev)
		/* Ethernet TAP Device */
		ether_setup(dev);
		dev->priv_flags &= ~IFF_TX_SKB_SHARING;
+		dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

		eth_hw_addr_random(dev);
Would this possibly apply to L2TP devices as well?
L2TP does not allow changing mac address at all right now.
Only drivers that use eth_mac_addr, can take advantage of the flag.


Looking around here are the other places that could use it.
 vxlan, xen-netfront?, gre, gre6, virtio_net?, hyperv?

Also the following look buggy.
  c2 allows changing mac address but never tells hardware?
  isdn/hysdn_net.c allows setting mac address but then resets it
      card value in net_open
  xpnet allows setting address but it looks like it fixed by hardware
  ipddp allows ethernet address but protocol is not ethernet
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help