提交 c9dca822 编写于 作者: J Jian Yang 提交者: 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: NMahesh Bandewar <maheshb@google.com>
Signed-off-by: NJian Yang <jianyang@google.com>
Link: https://lore.kernel.org/r/20210201233445.2044327-1-jianyang.kernel@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 e64ffa88
......@@ -219,6 +219,12 @@ static __net_init int loopback_net_init(struct net *net)
BUG_ON(dev->ifindex != LOOPBACK_IFINDEX);
net->loopback_dev = dev;
/* bring loopback device UP */
rtnl_lock();
dev_open(dev, NULL);
rtnl_unlock();
return 0;
out_free_netdev:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册