aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-13 17:56:26 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-15 13:45:03 -0400
commite87cc4728f0e2fb663e592a1141742b1d6c63256 (patch)
treeb8219696d37f0c8d0521d5853560b97fc96dc667 /net/ipv4/route.c
parent3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c (diff)
net: Convert net_ratelimit uses to net_<level>_ratelimited
Standardize the net core ratelimited logging functions. Coalesce formats, align arguments. Change a printk then vprintk sequence to use printf extension %pV. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 5773f5d9e21..42d76441501 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -960,8 +960,7 @@ void rt_cache_flush_batch(struct net *net)
960 960
961static void rt_emergency_hash_rebuild(struct net *net) 961static void rt_emergency_hash_rebuild(struct net *net)
962{ 962{
963 if (net_ratelimit()) 963 net_warn_ratelimited("Route hash chain too long!\n");
964 pr_warn("Route hash chain too long!\n");
965 rt_cache_invalidate(net); 964 rt_cache_invalidate(net);
966} 965}
967 966
@@ -1084,8 +1083,7 @@ static int rt_garbage_collect(struct dst_ops *ops)
1084 goto out; 1083 goto out;
1085 if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size) 1084 if (dst_entries_get_slow(&ipv4_dst_ops) < ip_rt_max_size)
1086 goto out; 1085 goto out;
1087 if (net_ratelimit()) 1086 net_warn_ratelimited("dst cache overflow\n");
1088 pr_warn("dst cache overflow\n");
1089 RT_CACHE_STAT_INC(gc_dst_overflow); 1087 RT_CACHE_STAT_INC(gc_dst_overflow);
1090 return 1; 1088 return 1;
1091 1089
@@ -1182,8 +1180,7 @@ restart:
1182 if (rt->rt_type == RTN_UNICAST || rt_is_output_route(rt)) { 1180 if (rt->rt_type == RTN_UNICAST || rt_is_output_route(rt)) {
1183 int err = rt_bind_neighbour(rt); 1181 int err = rt_bind_neighbour(rt);
1184 if (err) { 1182 if (err) {
1185 if (net_ratelimit()) 1183 net_warn_ratelimited("Neighbour table failure & not caching routes\n");
1186 pr_warn("Neighbour table failure & not caching routes\n");
1187 ip_rt_put(rt); 1184 ip_rt_put(rt);
1188 return ERR_PTR(err); 1185 return ERR_PTR(err);
1189 } 1186 }
@@ -1299,8 +1296,7 @@ restart:
1299 goto restart; 1296 goto restart;
1300 } 1297 }
1301 1298
1302 if (net_ratelimit()) 1299 net_warn_ratelimited("Neighbour table overflow\n");
1303 pr_warn("Neighbour table overflow\n");
1304 rt_drop(rt); 1300 rt_drop(rt);
1305 return ERR_PTR(-ENOBUFS); 1301 return ERR_PTR(-ENOBUFS);
1306 } 1302 }
@@ -1503,11 +1499,11 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
1503 1499
1504reject_redirect: 1500reject_redirect:
1505#ifdef CONFIG_IP_ROUTE_VERBOSE 1501#ifdef CONFIG_IP_ROUTE_VERBOSE
1506 if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) 1502 if (IN_DEV_LOG_MARTIANS(in_dev))
1507 pr_info("Redirect from %pI4 on %s about %pI4 ignored\n" 1503 net_info_ratelimited("Redirect from %pI4 on %s about %pI4 ignored\n"
1508 " Advised path = %pI4 -> %pI4\n", 1504 " Advised path = %pI4 -> %pI4\n",
1509 &old_gw, dev->name, &new_gw, 1505 &old_gw, dev->name, &new_gw,
1510 &saddr, &daddr); 1506 &saddr, &daddr);
1511#endif 1507#endif
1512 ; 1508 ;
1513} 1509}
@@ -1617,11 +1613,10 @@ void ip_rt_send_redirect(struct sk_buff *skb)
1617 ++peer->rate_tokens; 1613 ++peer->rate_tokens;
1618#ifdef CONFIG_IP_ROUTE_VERBOSE 1614#ifdef CONFIG_IP_ROUTE_VERBOSE
1619 if (log_martians && 1615 if (log_martians &&
1620 peer->rate_tokens == ip_rt_redirect_number && 1616 peer->rate_tokens == ip_rt_redirect_number)
1621 net_ratelimit()) 1617 net_warn_ratelimited("host %pI4/if%d ignores redirects for %pI4 to %pI4\n",
1622 pr_warn("host %pI4/if%d ignores redirects for %pI4 to %pI4\n", 1618 &ip_hdr(skb)->saddr, rt->rt_iif,
1623 &ip_hdr(skb)->saddr, rt->rt_iif, 1619 &rt->rt_dst, &rt->rt_gateway);
1624 &rt->rt_dst, &rt->rt_gateway);
1625#endif 1620#endif
1626 } 1621 }
1627} 1622}
@@ -2135,8 +2130,7 @@ static int __mkroute_input(struct sk_buff *skb,
2135 /* get a working reference to the output device */ 2130 /* get a working reference to the output device */
2136 out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res)); 2131 out_dev = __in_dev_get_rcu(FIB_RES_DEV(*res));
2137 if (out_dev == NULL) { 2132 if (out_dev == NULL) {
2138 if (net_ratelimit()) 2133 net_crit_ratelimited("Bug in ip_route_input_slow(). Please report.\n");
2139 pr_crit("Bug in ip_route_input_slow(). Please report.\n");
2140 return -EINVAL; 2134 return -EINVAL;
2141 } 2135 }
2142 2136
@@ -2407,9 +2401,9 @@ no_route:
2407martian_destination: 2401martian_destination:
2408 RT_CACHE_STAT_INC(in_martian_dst); 2402 RT_CACHE_STAT_INC(in_martian_dst);
2409#ifdef CONFIG_IP_ROUTE_VERBOSE 2403#ifdef CONFIG_IP_ROUTE_VERBOSE
2410 if (IN_DEV_LOG_MARTIANS(in_dev) && net_ratelimit()) 2404 if (IN_DEV_LOG_MARTIANS(in_dev))
2411 pr_warn("martian destination %pI4 from %pI4, dev %s\n", 2405 net_warn_ratelimited("martian destination %pI4 from %pI4, dev %s\n",
2412 &daddr, &saddr, dev->name); 2406 &daddr, &saddr, dev->name);
2413#endif 2407#endif
2414 2408
2415e_hostunreach: 2409e_hostunreach: