* [PATCH] ip_gre: fix ip-config error reported by lkp-robot
@ 2017-11-07 15:57 William Tu
2017-11-13 0:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: William Tu @ 2017-11-07 15:57 UTC (permalink / raw)
To: netdev
lkp-robot reports the following two errors:
IP-Config: Failed to open gretap0
IP-Config: Failed to open erspan0
due to device's mac address is zero. Fix it by assigning
a random Ethernet address.
Signed-off-by: William Tu <u9012063@gmail.com>
---
net/ipv4/ip_gre.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index c105a315b1a3..1529a44f6945 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -998,6 +998,9 @@ static int ipgre_tunnel_init(struct net_device *dev)
dev->header_ops = &ipgre_header_ops;
}
+ if (is_zero_ether_addr(dev->dev_addr))
+ eth_hw_addr_random(dev);
+
return ip_tunnel_init(dev);
}
@@ -1222,6 +1225,9 @@ static int gre_tap_init(struct net_device *dev)
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
netif_keep_dst(dev);
+ if (is_zero_ether_addr(dev->dev_addr))
+ eth_hw_addr_random(dev);
+
return ip_tunnel_init(dev);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ip_gre: fix ip-config error reported by lkp-robot
2017-11-07 15:57 [PATCH] ip_gre: fix ip-config error reported by lkp-robot William Tu
@ 2017-11-13 0:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-13 0:58 UTC (permalink / raw)
To: u9012063; +Cc: netdev
From: William Tu <u9012063@gmail.com>
Date: Tue, 7 Nov 2017 07:57:44 -0800
> lkp-robot reports the following two errors:
> IP-Config: Failed to open gretap0
> IP-Config: Failed to open erspan0
> due to device's mac address is zero. Fix it by assigning
> a random Ethernet address.
>
> Signed-off-by: William Tu <u9012063@gmail.com>
This isn't really a good idea.
If there is a tunnel source address of zero, which is where the device
address comes from, we shouldn't allow the interface to come up
because it is misconfigured.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-13 0:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 15:57 [PATCH] ip_gre: fix ip-config error reported by lkp-robot William Tu
2017-11-13 0:58 ` David Miller
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).