mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
aa79e66eee
commit
1fb9489bf1
8 changed files with 18 additions and 10 deletions
|
@ -105,6 +105,13 @@ struct net {
|
|||
struct sock *diag_nlsk;
|
||||
};
|
||||
|
||||
/*
|
||||
* ifindex generation is per-net namespace, and loopback is
|
||||
* always the 1st device in ns (see net_dev_init), thus any
|
||||
* loopback device should get ifindex 1
|
||||
*/
|
||||
|
||||
#define LOOPBACK_IFINDEX 1
|
||||
|
||||
#include <linux/seq_file_net.h>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue