diff options
author | Joe Perches <joe@perches.com> | 2012-05-13 17:56:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-15 13:45:03 -0400 |
commit | e87cc4728f0e2fb663e592a1141742b1d6c63256 (patch) | |
tree | b8219696d37f0c8d0521d5853560b97fc96dc667 /net/ipv6/ip6_tunnel.c | |
parent | 3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c (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/ipv6/ip6_tunnel.c')
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 5df487c81ed9..27fec272d39d 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -460,19 +460,14 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, | |||
460 | struct ipv6_tlv_tnl_enc_lim *tel; | 460 | struct ipv6_tlv_tnl_enc_lim *tel; |
461 | __u32 mtu; | 461 | __u32 mtu; |
462 | case ICMPV6_DEST_UNREACH: | 462 | case ICMPV6_DEST_UNREACH: |
463 | if (net_ratelimit()) | 463 | net_warn_ratelimited("%s: Path to destination invalid or inactive!\n", |
464 | printk(KERN_WARNING | 464 | t->parms.name); |
465 | "%s: Path to destination invalid " | ||
466 | "or inactive!\n", t->parms.name); | ||
467 | rel_msg = 1; | 465 | rel_msg = 1; |
468 | break; | 466 | break; |
469 | case ICMPV6_TIME_EXCEED: | 467 | case ICMPV6_TIME_EXCEED: |
470 | if ((*code) == ICMPV6_EXC_HOPLIMIT) { | 468 | if ((*code) == ICMPV6_EXC_HOPLIMIT) { |
471 | if (net_ratelimit()) | 469 | net_warn_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n", |
472 | printk(KERN_WARNING | 470 | t->parms.name); |
473 | "%s: Too small hop limit or " | ||
474 | "routing loop in tunnel!\n", | ||
475 | t->parms.name); | ||
476 | rel_msg = 1; | 471 | rel_msg = 1; |
477 | } | 472 | } |
478 | break; | 473 | break; |
@@ -484,17 +479,13 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt, | |||
484 | if (teli && teli == *info - 2) { | 479 | if (teli && teli == *info - 2) { |
485 | tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli]; | 480 | tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli]; |
486 | if (tel->encap_limit == 0) { | 481 | if (tel->encap_limit == 0) { |
487 | if (net_ratelimit()) | 482 | net_warn_ratelimited("%s: Too small encapsulation limit or routing loop in tunnel!\n", |
488 | printk(KERN_WARNING | 483 | t->parms.name); |
489 | "%s: Too small encapsulation " | ||
490 | "limit or routing loop in " | ||
491 | "tunnel!\n", t->parms.name); | ||
492 | rel_msg = 1; | 484 | rel_msg = 1; |
493 | } | 485 | } |
494 | } else if (net_ratelimit()) { | 486 | } else { |
495 | printk(KERN_WARNING | 487 | net_warn_ratelimited("%s: Recipient unable to parse tunneled packet!\n", |
496 | "%s: Recipient unable to parse tunneled " | 488 | t->parms.name); |
497 | "packet!\n ", t->parms.name); | ||
498 | } | 489 | } |
499 | break; | 490 | break; |
500 | case ICMPV6_PKT_TOOBIG: | 491 | case ICMPV6_PKT_TOOBIG: |
@@ -919,10 +910,8 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
919 | 910 | ||
920 | if (tdev == dev) { | 911 | if (tdev == dev) { |
921 | stats->collisions++; | 912 | stats->collisions++; |
922 | if (net_ratelimit()) | 913 | net_warn_ratelimited("%s: Local routing loop detected!\n", |
923 | printk(KERN_WARNING | 914 | t->parms.name); |
924 | "%s: Local routing loop detected!\n", | ||
925 | t->parms.name); | ||
926 | goto tx_err_dst_release; | 915 | goto tx_err_dst_release; |
927 | } | 916 | } |
928 | mtu = dst_mtu(dst) - sizeof (*ipv6h); | 917 | mtu = dst_mtu(dst) - sizeof (*ipv6h); |