[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20170704191623.6583-1-mahesh@bandewar.net>
Date: Tue, 4 Jul 2017 12:16:23 -0700
From: Mahesh Bandewar <mahesh@...dewar.net>
To: James Morris <jmorris@...ei.org>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Patrick McHardy <kaber@...sh.net>,
David Miller <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Eric Biederman <ebiederm@...ssion.com>
Cc: netdev <netdev@...r.kernel.org>,
Mahesh Bandewar <mahesh@...dewar.net>,
Mahesh Bandewar <maheshb@...gle.com>
Subject: [PATCH 2/2] loopback: bringup 'lo' by default at initialization
From: Mahesh Bandewar <maheshb@...gle.com>
loopback devices are always brought up right after its initialization
including the case of network namespace creation. e.g.
ip netns add foo
ip -netns foo link set lo up
This patch will eliminate the need to do that separately and would bring
it up as part of the loopback initialization.
Signed-off-by: Mahesh Bandewar <maheshb@...gle.com>
---
drivers/net/loopback.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 30612497643c..3216977935d1 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -217,6 +217,12 @@ static __net_init int loopback_net_init(struct net *net)
BUG_ON(dev->ifindex != LOOPBACK_IFINDEX);
net->loopback_dev = dev;
+
+ /* Set the loopback device UP */
+ rtnl_lock();
+ dev_open(net->loopback_dev);
+ rtnl_unlock();
+
return 0;
out_free_netdev:
--
2.13.2.725.g09c95d1e9-goog
Powered by blists - more mailing lists