diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2012-08-08 21:53:36 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-09 16:18:07 -0700 |
commit | 1fb9489bf190ce2b3fc03891f3de4b2d30600e28 (patch) | |
tree | da4e17036949e72ae0b1f0fc3b6b31557de18353 /drivers/net/loopback.c | |
parent | aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 (diff) | |
download | linux-1fb9489bf190ce2b3fc03891f3de4b2d30600e28.tar.gz linux-1fb9489bf190ce2b3fc03891f3de4b2d30600e28.tar.bz2 linux-1fb9489bf190ce2b3fc03891f3de4b2d30600e28.zip |
net: Loopback ifindex is constant now
As pointed out, there are places, that access net->loopback_dev->ifindex
and after ifindex generation is made per-net this value becomes constant
equals 1. So go ahead and introduce the LOOPBACK_IFINDEX constant and use
it where appropriate.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r-- | drivers/net/loopback.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index e2a06fd996d5..4a075babe193 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -197,6 +197,7 @@ static __net_init int loopback_net_init(struct net *net) if (err) goto out_free_netdev; + BUG_ON(dev->ifindex != LOOPBACK_IFINDEX); net->loopback_dev = dev; return 0; |