Commit c9dca822 authored by Jian Yang's avatar Jian Yang Committed by Jakub Kicinski

net-loopback: set lo dev initial state to UP

Traditionally loopback devices come up with initial state as DOWN for
any new network-namespace. This would mean that anyone needing this
device would have to bring this UP by issuing something like 'ip link
set lo up'. This can be avoided if the initial state is set as UP.
Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
Signed-off-by: default avatarJian Yang <jianyang@google.com>
Link: https://lore.kernel.org/r/20210201233445.2044327-1-jianyang.kernel@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e64ffa88
...@@ -219,6 +219,12 @@ static __net_init int loopback_net_init(struct net *net) ...@@ -219,6 +219,12 @@ static __net_init int loopback_net_init(struct net *net)
BUG_ON(dev->ifindex != LOOPBACK_IFINDEX); BUG_ON(dev->ifindex != LOOPBACK_IFINDEX);
net->loopback_dev = dev; net->loopback_dev = dev;
/* bring loopback device UP */
rtnl_lock();
dev_open(dev, NULL);
rtnl_unlock();
return 0; return 0;
out_free_netdev: out_free_netdev:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment