[NET]: Dynamically allocate the loopback device, part 1.
This patch replaces all occurences to the static variable loopback_dev to a pointer loopback_dev. That provides the mindless, trivial, uninteressting change part for the dynamic allocation for the loopback. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Acked-By: Kirill Korotaev <dev@sw.ru> Acked-by: Benjamin Thery <benjamin.thery@bull.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
5568296573
commit
de3cb747ff
@@ -203,7 +203,7 @@ static void inetdev_destroy(struct in_device *in_dev)
|
||||
ASSERT_RTNL();
|
||||
|
||||
dev = in_dev->dev;
|
||||
if (dev == &loopback_dev)
|
||||
if (dev == loopback_dev)
|
||||
return;
|
||||
|
||||
in_dev->dead = 1;
|
||||
@@ -1061,7 +1061,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
|
||||
in_dev = inetdev_init(dev);
|
||||
if (!in_dev)
|
||||
return notifier_from_errno(-ENOMEM);
|
||||
if (dev == &loopback_dev) {
|
||||
if (dev == loopback_dev) {
|
||||
IN_DEV_CONF_SET(in_dev, NOXFRM, 1);
|
||||
IN_DEV_CONF_SET(in_dev, NOPOLICY, 1);
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
|
||||
case NETDEV_UP:
|
||||
if (dev->mtu < 68)
|
||||
break;
|
||||
if (dev == &loopback_dev) {
|
||||
if (dev == loopback_dev) {
|
||||
struct in_ifaddr *ifa;
|
||||
if ((ifa = inet_alloc_ifa()) != NULL) {
|
||||
ifa->ifa_local =
|
||||
|
Reference in New Issue
Block a user