summaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter
diff options
context:
space:
mode:
authorPavel Emelyanov2012-08-08 23:53:36 +0200
committerDavid S. Miller2012-08-10 01:18:07 +0200
commit1fb9489bf190ce2b3fc03891f3de4b2d30600e28 (patch)
treeda4e17036949e72ae0b1f0fc3b6b31557de18353 /net/ipv4/netfilter
parentnet: Make ifindex generation per-net namespace (diff)
downloadkernel-qcow2-linux-1fb9489bf190ce2b3fc03891f3de4b2d30600e28.tar.gz
kernel-qcow2-linux-1fb9489bf190ce2b3fc03891f3de4b2d30600e28.tar.xz
kernel-qcow2-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 'net/ipv4/netfilter')
-rw-r--r--net/ipv4/netfilter/ipt_rpfilter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/netfilter/ipt_rpfilter.c b/net/ipv4/netfilter/ipt_rpfilter.c
index 31371be8174b..c30130062cd6 100644
--- a/net/ipv4/netfilter/ipt_rpfilter.c
+++ b/net/ipv4/netfilter/ipt_rpfilter.c
@@ -85,7 +85,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)
return ipv4_is_local_multicast(iph->daddr) ^ invert;
flow.flowi4_iif = 0;
} else {
- flow.flowi4_iif = dev_net(par->in)->loopback_dev->ifindex;
+ flow.flowi4_iif = LOOPBACK_IFINDEX;
}
flow.daddr = iph->saddr;