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
@@ -218,7 +218,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb)
|
||||
scope = RT_SCOPE_UNIVERSE;
|
||||
if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) {
|
||||
fl4.flowi4_oif = 0;
|
||||
fl4.flowi4_iif = net->loopback_dev->ifindex;
|
||||
fl4.flowi4_iif = LOOPBACK_IFINDEX;
|
||||
fl4.daddr = ip_hdr(skb)->saddr;
|
||||
fl4.saddr = 0;
|
||||
fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos);
|
||||
|
Reference in New Issue
Block a user