netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] net: allow setting mac address of loopback device
@ 2014-01-29 23:38 Cong Wang
  2014-01-30 12:04 ` Neil Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cong Wang @ 2014-01-29 23:38 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger, Eric Dumazet, David S. Miller, Cong Wang

We are trying to mirror the local traffic from lo to eth0,
allowing setting mac address of lo to eth0 would make
the ether addresses in these packets correct, so that
we don't have to modify the ether header again.

Since usually no one cares about its mac address (all-zero),
it is safe to allow those who care to set its mac address.

Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

---
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index c5011e0..a0ee030 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -160,6 +160,7 @@ static const struct net_device_ops loopback_ops = {
 	.ndo_init      = loopback_dev_init,
 	.ndo_start_xmit= loopback_xmit,
 	.ndo_get_stats64 = loopback_get_stats64,
+	.ndo_set_mac_address = eth_mac_addr,
 };
 
 /*

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

end of thread, other threads:[~2014-02-01  0:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-29 23:38 [Patch net] net: allow setting mac address of loopback device Cong Wang
2014-01-30 12:04 ` Neil Horman
2014-01-30 14:42 ` Hannes Frederic Sowa
2014-02-01  0:42   ` Cong Wang
2014-01-31  0:27 ` David Miller
2014-02-01  0:43   ` Cong Wang

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