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:

committed by
David S. Miller

parent
aa79e66eee
commit
1fb9489bf1
@@ -1798,7 +1798,7 @@ static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
|
||||
.flowi4_oif = (rt_is_output_route(rt) ?
|
||||
skb->dev->ifindex : 0),
|
||||
.flowi4_iif = (rt_is_output_route(rt) ?
|
||||
net->loopback_dev->ifindex :
|
||||
LOOPBACK_IFINDEX :
|
||||
skb->dev->ifindex),
|
||||
.flowi4_mark = skb->mark,
|
||||
};
|
||||
|
Reference in New Issue
Block a user