Skip to content

Commit 184c4dc

Browse files
idoschgregkh
authored andcommitted
ipv6_tunnel: Rate limit warning messages
commit 6cee105 upstream. The warning messages can be invoked from the data path for every packet transmitted through an ip6gre netdev, leading to high CPU utilization. Fix that by rate limiting the messages. Fixes: 09c6bbf ("[IPV6]: Do mandatory IPv6 tunnel endpoint checks in realtime") Reported-by: Maksym Yaremchuk <[email protected]> Tested-by: Maksym Yaremchuk <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Amit Cohen <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent ace7b6e commit 184c4dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/ipv6/ip6_tunnel.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,14 +1036,14 @@ int ip6_tnl_xmit_ctl(struct ip6_tnl *t,
10361036

10371037
if (unlikely(!ipv6_chk_addr_and_flags(net, laddr, ldev, false,
10381038
0, IFA_F_TENTATIVE)))
1039-
pr_warn("%s xmit: Local address not yet configured!\n",
1040-
p->name);
1039+
pr_warn_ratelimited("%s xmit: Local address not yet configured!\n",
1040+
p->name);
10411041
else if (!(p->flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE) &&
10421042
!ipv6_addr_is_multicast(raddr) &&
10431043
unlikely(ipv6_chk_addr_and_flags(net, raddr, ldev,
10441044
true, 0, IFA_F_TENTATIVE)))
1045-
pr_warn("%s xmit: Routing loop! Remote address found on this node!\n",
1046-
p->name);
1045+
pr_warn_ratelimited("%s xmit: Routing loop! Remote address found on this node!\n",
1046+
p->name);
10471047
else
10481048
ret = 1;
10491049
rcu_read_unlock();

0 commit comments

Comments
 (0)