提交 9d6dda32 编写于 作者: P Pavel Emelyanov 提交者: David S. Miller

[NETNS]: Don't panic on creating the namespace's loopback

When the loopback device is failed to initialize inside the new 
namespaces, panic() is called. Do not do it when the namespace 
in question is not the init_net.

Plus cleanup the error path a bit.
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4ae28944
......@@ -265,17 +265,16 @@ static __net_init int loopback_net_init(struct net *net)
if (err)
goto out_free_netdev;
err = 0;
net->loopback_dev = dev;
return 0;
out:
if (err)
panic("loopback: Failed to register netdevice: %d\n", err);
return err;
out_free_netdev:
free_netdev(dev);
goto out;
out:
if (net == &init_net)
panic("loopback: Failed to register netdevice: %d\n", err);
return err;
}
static __net_exit void loopback_net_exit(struct net *net)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册