[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
@@ -278,13 +278,13 @@ static inline void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
|
||||
if (!unregister) {
|
||||
dst->input = dst->output = dst_discard;
|
||||
} else {
|
||||
dst->dev = &loopback_dev;
|
||||
dev_hold(&loopback_dev);
|
||||
dst->dev = loopback_dev;
|
||||
dev_hold(dst->dev);
|
||||
dev_put(dev);
|
||||
if (dst->neighbour && dst->neighbour->dev == dev) {
|
||||
dst->neighbour->dev = &loopback_dev;
|
||||
dst->neighbour->dev = loopback_dev;
|
||||
dev_put(dev);
|
||||
dev_hold(&loopback_dev);
|
||||
dev_hold(dst->neighbour->dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user