Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8030f544 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

[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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
parent 45ba9dd2
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1054,13 +1054,15 @@ 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");
			if (dev == &loopback_dev) {
				in_dev->cnf.no_xfrm = 1;
				in_dev->cnf.no_policy = 1;
			}
		}
		goto out;
	}