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
@@ -965,7 +965,7 @@ struct dst_entry * ip6_route_output(struct net *net, const struct sock *sk,
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
fl6->flowi6_iif = net->loopback_dev->ifindex;
|
||||
fl6->flowi6_iif = LOOPBACK_IFINDEX;
|
||||
|
||||
if ((sk && sk->sk_bound_dev_if) || rt6_need_strict(&fl6->daddr))
|
||||
flags |= RT6_LOOKUP_F_IFACE;
|
||||
|
Reference in New Issue
Block a user