ip_gre: fix ip-config error reported by lkp-robot
Subsystems (3)
PATCH 1/1 ip_gre: fix ip-config error reported by lkp-robot
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 <[email protected]>
--- net/ipv4/ip_gre.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/ipv4/ip_gre.c +6 -0
@@ -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); }
Signature · 1 line
2.7.4
David Miller
maintainerFrom: William Tu <[email protected]>
Date: Tue, 7 Nov 2017 07:57:44 -0800
Quoted 7 lines
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 <[email protected]>
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.