summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2024-08-29 14:46:40 +0000
committerJakub Kicinski <kuba@kernel.org>2024-08-30 11:14:06 -0700
commitb056b4cd9178f7a1d5d57f7b48b073c29729ddaa (patch)
treec52e88f67befd08e2f9c751d342c850029ebfd73 /net/ipv6
parent8c2bd38b95f75f3d2a08c93e35303e26d480d24e (diff)
downloadlinux-b056b4cd9178f7a1d5d57f7b48b073c29729ddaa.tar.gz
linux-b056b4cd9178f7a1d5d57f7b48b073c29729ddaa.tar.bz2
linux-b056b4cd9178f7a1d5d57f7b48b073c29729ddaa.zip
icmp: move icmp_global.credit and icmp_global.stamp to per netns storage
Host wide ICMP ratelimiter should be per netns, to provide better isolation. Following patch in this series makes the sysctl per netns. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20240829144641.3880376-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/icmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 46f70e4a8351..071b0bc1179d 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -181,7 +181,7 @@ static bool icmpv6_global_allow(struct net *net, int type,
if (icmpv6_mask_allow(net, type))
return true;
- if (icmp_global_allow()) {
+ if (icmp_global_allow(net)) {
*apply_ratelimit = true;
return true;
}
@@ -231,7 +231,7 @@ static bool icmpv6_xrlim_allow(struct sock *sk, u8 type,
__ICMP6_INC_STATS(net, ip6_dst_idev(dst),
ICMP6_MIB_RATELIMITHOST);
else
- icmp_global_consume();
+ icmp_global_consume(net);
dst_release(dst);
return res;
}