Skip to content

Commit

Permalink
[IPV4] devinet: Register inetdev earlier.
Browse files Browse the repository at this point in the history
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 <herbert@gondor.apana.org.au>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Feb 26, 2007
1 parent 45ba9dd commit 8030f54
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/ipv4/devinet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8030f54

Please sign in to comment.