From: Herbert Xu Date: Wed, 21 Feb 2007 16:53:47 +0000 (+0900) Subject: [IPV4] devinet: Register inetdev earlier. X-Git-Tag: firefly_0821_release~30988^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8030f54499925d073a88c09f30d5d844fb1b3190;p=firefly-linux-kernel-4.4.55.git [IPV4] devinet: Register inetdev earlier. This patch allocates inetdev at registration for all devices in line with IPv6. This allows sysctl configuration on the devices to occur before they're brought up or addresses are added. Signed-off-by: Herbert Xu Signed-off-by: YOSHIFUJI Hideaki --- diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 8a0ec10a13a7..e10794dc5f64 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1054,12 +1054,14 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, ASSERT_RTNL(); if (!in_dev) { - if (event == NETDEV_REGISTER && dev == &loopback_dev) { + if (event == NETDEV_REGISTER) { in_dev = inetdev_init(dev); if (!in_dev) panic("devinet: Failed to create loopback\n"); - in_dev->cnf.no_xfrm = 1; - in_dev->cnf.no_policy = 1; + if (dev == &loopback_dev) { + in_dev->cnf.no_xfrm = 1; + in_dev->cnf.no_policy = 1; + } } goto out; }