net: Convert net_ratelimit uses to net_<level>_ratelimited
[pandora-kernel.git] / net / ipv6 / ip6_tunnel.c
index 5df487c..27fec27 100644 (file)
@@ -460,19 +460,14 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
                struct ipv6_tlv_tnl_enc_lim *tel;
                __u32 mtu;
        case ICMPV6_DEST_UNREACH:
-               if (net_ratelimit())
-                       printk(KERN_WARNING
-                              "%s: Path to destination invalid "
-                              "or inactive!\n", t->parms.name);
+               net_warn_ratelimited("%s: Path to destination invalid or inactive!\n",
+                                    t->parms.name);
                rel_msg = 1;
                break;
        case ICMPV6_TIME_EXCEED:
                if ((*code) == ICMPV6_EXC_HOPLIMIT) {
-                       if (net_ratelimit())
-                               printk(KERN_WARNING
-                                      "%s: Too small hop limit or "
-                                      "routing loop in tunnel!\n",
-                                      t->parms.name);
+                       net_warn_ratelimited("%s: Too small hop limit or routing loop in tunnel!\n",
+                                            t->parms.name);
                        rel_msg = 1;
                }
                break;
@@ -484,17 +479,13 @@ ip6_tnl_err(struct sk_buff *skb, __u8 ipproto, struct inet6_skb_parm *opt,
                if (teli && teli == *info - 2) {
                        tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli];
                        if (tel->encap_limit == 0) {
-                               if (net_ratelimit())
-                                       printk(KERN_WARNING
-                                              "%s: Too small encapsulation "
-                                              "limit or routing loop in "
-                                              "tunnel!\n", t->parms.name);
+                               net_warn_ratelimited("%s: Too small encapsulation limit or routing loop in tunnel!\n",
+                                                    t->parms.name);
                                rel_msg = 1;
                        }
-               } else if (net_ratelimit()) {
-                       printk(KERN_WARNING
-                              "%s: Recipient unable to parse tunneled "
-                              "packet!\n ", t->parms.name);
+               } else {
+                       net_warn_ratelimited("%s: Recipient unable to parse tunneled packet!\n",
+                                            t->parms.name);
                }
                break;
        case ICMPV6_PKT_TOOBIG:
@@ -919,10 +910,8 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
 
        if (tdev == dev) {
                stats->collisions++;
-               if (net_ratelimit())
-                       printk(KERN_WARNING
-                              "%s: Local routing loop detected!\n",
-                              t->parms.name);
+               net_warn_ratelimited("%s: Local routing loop detected!\n",
+                                    t->parms.name);
                goto tx_err_dst_release;
        }
        mtu = dst_mtu(dst) - sizeof (*ipv6h);