Skip to content

Commit 8030f54

Browse files
herbertxDavid S. Miller
authored andcommitted
[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 <[email protected]> Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
1 parent 45ba9dd commit 8030f54

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

net/ipv4/devinet.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,12 +1054,14 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
10541054
ASSERT_RTNL();
10551055

10561056
if (!in_dev) {
1057-
if (event == NETDEV_REGISTER && dev == &loopback_dev) {
1057+
if (event == NETDEV_REGISTER) {
10581058
in_dev = inetdev_init(dev);
10591059
if (!in_dev)
10601060
panic("devinet: Failed to create loopback\n");
1061-
in_dev->cnf.no_xfrm = 1;
1062-
in_dev->cnf.no_policy = 1;
1061+
if (dev == &loopback_dev) {
1062+
in_dev->cnf.no_xfrm = 1;
1063+
in_dev->cnf.no_policy = 1;
1064+
}
10631065
}
10641066
goto out;
10651067
}

0 commit comments

Comments
 (0)