summaryrefslogtreecommitdiffstats
path: root/net/ipv4/icmp.c
diff options
context:
space:
mode:
authorDavid Ahern2015-08-28 01:07:03 +0200
committerDavid S. Miller2015-08-28 22:32:36 +0200
commit192132b9a034d87566294be0fba5f8f75c2cf16b (patch)
treec4d7126eb3cd4eb84effc223fb98fdf8e0b80658 /net/ipv4/icmp.c
parentnet: Refactor inetpeer address struct (diff)
downloadkernel-qcow2-linux-192132b9a034d87566294be0fba5f8f75c2cf16b.tar.gz
kernel-qcow2-linux-192132b9a034d87566294be0fba5f8f75c2cf16b.tar.xz
kernel-qcow2-linux-192132b9a034d87566294be0fba5f8f75c2cf16b.zip
net: Add support for VRFs to inetpeer cache
inetpeer caches based on address only, so duplicate IP addresses within a namespace return the same cached entry. Enhance the ipv4 address key to contain both the IPv4 address and VRF device index. Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r--net/ipv4/icmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index f16488efa1c8..79fe05befcae 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -309,9 +309,10 @@ static bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
rc = false;
if (icmp_global_allow()) {
+ int vif = vrf_master_ifindex(dst->dev);
struct inet_peer *peer;
- peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, 1);
+ peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, vif, 1);
rc = inet_peer_xrlim_allow(peer,
net->ipv4.sysctl_icmp_ratelimit);
if (peer)