aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--net/atm/ioctl.c8
-rw-r--r--net/caif/caif_socket.c10
-rw-r--r--net/core/dev.c30
-rw-r--r--net/core/pktgen.c7
-rw-r--r--net/core/rtnetlink.c8
-rw-r--r--net/core/skbuff.c11
-rw-r--r--net/decnet/dn_fib.c5
-rw-r--r--net/decnet/dn_neigh.c22
-rw-r--r--net/decnet/dn_nsp_in.c11
-rw-r--r--net/decnet/dn_nsp_out.c5
-rw-r--r--net/decnet/dn_route.c15
-rw-r--r--net/decnet/dn_table.c4
-rw-r--r--net/decnet/netfilter/dn_rtmsg.c3
-rw-r--r--net/ipv4/icmp.c20
-rw-r--r--net/ipv4/ip_fragment.c3
-rw-r--r--net/ipv4/ip_input.c13
-rw-r--r--net/ipv4/ip_options.c6
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/ipconfig.c11
-rw-r--r--net/ipv4/ipmr.c3
-rw-r--r--net/ipv4/netfilter/arp_tables.c5
-rw-r--r--net/ipv4/netfilter/ip_tables.c3
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c3
-rw-r--r--net/ipv4/netfilter/nf_nat_h323.c26
-rw-r--r--net/ipv4/netfilter/nf_nat_snmp_basic.c8
-rw-r--r--net/ipv4/route.c40
-rw-r--r--net/ipv4/tcp.c14
-rw-r--r--net/ipv4/tcp_input.c7
-rw-r--r--net/ipv4/tcp_ipv4.c11
-rw-r--r--net/ipv4/tcp_output.c3
-rw-r--r--net/ipv6/addrconf.c17
-rw-r--r--net/ipv6/ah6.c4
-rw-r--r--net/ipv6/ip6_output.c3
-rw-r--r--net/ipv6/ip6_tunnel.c33
-rw-r--r--net/ipv6/ip6mr.c3
-rw-r--r--net/ipv6/netfilter/ip6_tables.c3
-rw-r--r--net/ipv6/netfilter/ip6t_REJECT.c6
-rw-r--r--net/ipv6/netfilter/ip6table_mangle.c3
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c3
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c7
-rw-r--r--net/ipv6/reassembly.c6
-rw-r--r--net/ipv6/route.c12
-rw-r--r--net/ipv6/sit.c6
-rw-r--r--net/ipv6/tcp_ipv6.c10
-rw-r--r--net/llc/af_llc.c7
-rw-r--r--net/mac80211/agg-rx.c13
-rw-r--r--net/mac80211/ht.c8
-rw-r--r--net/mac80211/ibss.c10
-rw-r--r--net/mac80211/mlme.c12
-rw-r--r--net/mac80211/rx.c11
-rw-r--r--net/mac80211/tx.c17
-rw-r--r--net/netfilter/nf_conntrack_amanda.c3
-rw-r--r--net/netfilter/nf_conntrack_core.c5
-rw-r--r--net/netfilter/nf_conntrack_expect.c4
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c9
-rw-r--r--net/netfilter/nf_conntrack_irc.c8
-rw-r--r--net/netfilter/nfnetlink_queue.c9
-rw-r--r--net/netfilter/xt_TCPMSS.c10
-rw-r--r--net/netfilter/xt_hashlimit.c3
-rw-r--r--net/openvswitch/vport-netdev.c6
-rw-r--r--net/sched/act_ipt.c7
-rw-r--r--net/sched/act_mirred.c5
-rw-r--r--net/sched/cls_u32.c3
-rw-r--r--net/sched/ematch.c4
-rw-r--r--net/sched/sch_api.c10
-rw-r--r--net/sched/sch_generic.c11
-rw-r--r--net/sched/sch_gred.c12
-rw-r--r--net/sctp/sm_sideeffect.c5
-rw-r--r--net/sctp/sm_statefuns.c18
-rw-r--r--net/sctp/socket.c6
-rw-r--r--net/socket.c3
-rw-r--r--net/sunrpc/svc.c18
-rw-r--r--net/sunrpc/svc_xprt.c13
-rw-r--r--net/sunrpc/svcsock.c28
-rw-r--r--net/wireless/lib80211_crypt_ccmp.c33
-rw-r--r--net/wireless/lib80211_crypt_tkip.c50
76 files changed, 306 insertions, 490 deletions
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
index 62dc8bfe6fe..bbd3b639992 100644
--- a/net/atm/ioctl.c
+++ b/net/atm/ioctl.c
@@ -97,9 +97,8 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
97 error = sock_get_timestampns(sk, argp); 97 error = sock_get_timestampns(sk, argp);
98 goto done; 98 goto done;
99 case ATM_SETSC: 99 case ATM_SETSC:
100 if (net_ratelimit()) 100 net_warn_ratelimited("ATM_SETSC is obsolete; used by %s:%d\n",
101 pr_warning("ATM_SETSC is obsolete; used by %s:%d\n", 101 current->comm, task_pid_nr(current));
102 current->comm, task_pid_nr(current));
103 error = 0; 102 error = 0;
104 goto done; 103 goto done;
105 case ATMSIGD_CTRL: 104 case ATMSIGD_CTRL:
@@ -123,8 +122,7 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
123 work for 32-bit userspace. TBH I don't really want 122 work for 32-bit userspace. TBH I don't really want
124 to think about it at all. dwmw2. */ 123 to think about it at all. dwmw2. */
125 if (compat) { 124 if (compat) {
126 if (net_ratelimit()) 125 net_warn_ratelimited("32-bit task cannot be atmsigd\n");
127 pr_warning("32-bit task cannot be atmsigd\n");
128 error = -EINVAL; 126 error = -EINVAL;
129 goto done; 127 goto done;
130 } 128 }
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 0dccdb3c7d2..fb894435526 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -131,10 +131,9 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
131 131
132 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= 132 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
133 (unsigned int)sk->sk_rcvbuf && rx_flow_is_on(cf_sk)) { 133 (unsigned int)sk->sk_rcvbuf && rx_flow_is_on(cf_sk)) {
134 if (net_ratelimit()) 134 net_dbg_ratelimited("sending flow OFF (queue len = %d %d)\n",
135 pr_debug("sending flow OFF (queue len = %d %d)\n", 135 atomic_read(&cf_sk->sk.sk_rmem_alloc),
136 atomic_read(&cf_sk->sk.sk_rmem_alloc), 136 sk_rcvbuf_lowwater(cf_sk));
137 sk_rcvbuf_lowwater(cf_sk));
138 set_rx_flow_off(cf_sk); 137 set_rx_flow_off(cf_sk);
139 caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ); 138 caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
140 } 139 }
@@ -144,8 +143,7 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
144 return err; 143 return err;
145 if (!sk_rmem_schedule(sk, skb->truesize) && rx_flow_is_on(cf_sk)) { 144 if (!sk_rmem_schedule(sk, skb->truesize) && rx_flow_is_on(cf_sk)) {
146 set_rx_flow_off(cf_sk); 145 set_rx_flow_off(cf_sk);
147 if (net_ratelimit()) 146 net_dbg_ratelimited("sending flow OFF due to rmem_schedule\n");
148 pr_debug("sending flow OFF due to rmem_schedule\n");
149 caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ); 147 caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
150 } 148 }
151 skb->dev = NULL; 149 skb->dev = NULL;
diff --git a/net/core/dev.c b/net/core/dev.c
index a2be59fe6ab..3dd853998d3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1673,10 +1673,9 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
1673 1673
1674 if (skb_network_header(skb2) < skb2->data || 1674 if (skb_network_header(skb2) < skb2->data ||
1675 skb2->network_header > skb2->tail) { 1675 skb2->network_header > skb2->tail) {
1676 if (net_ratelimit()) 1676 net_crit_ratelimited("protocol %04x is buggy, dev %s\n",
1677 pr_crit("protocol %04x is buggy, dev %s\n", 1677 ntohs(skb2->protocol),
1678 ntohs(skb2->protocol), 1678 dev->name);
1679 dev->name);
1680 skb_reset_network_header(skb2); 1679 skb_reset_network_header(skb2);
1681 } 1680 }
1682 1681
@@ -2343,11 +2342,9 @@ EXPORT_SYMBOL(__skb_tx_hash);
2343static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index) 2342static inline u16 dev_cap_txqueue(struct net_device *dev, u16 queue_index)
2344{ 2343{
2345 if (unlikely(queue_index >= dev->real_num_tx_queues)) { 2344 if (unlikely(queue_index >= dev->real_num_tx_queues)) {
2346 if (net_ratelimit()) { 2345 net_warn_ratelimited("%s selects TX queue %d, but real number of TX queues is %d\n",
2347 pr_warn("%s selects TX queue %d, but real number of TX queues is %d\n", 2346 dev->name, queue_index,
2348 dev->name, queue_index, 2347 dev->real_num_tx_queues);
2349 dev->real_num_tx_queues);
2350 }
2351 return 0; 2348 return 0;
2352 } 2349 }
2353 return queue_index; 2350 return queue_index;
@@ -2589,17 +2586,15 @@ int dev_queue_xmit(struct sk_buff *skb)
2589 } 2586 }
2590 } 2587 }
2591 HARD_TX_UNLOCK(dev, txq); 2588 HARD_TX_UNLOCK(dev, txq);
2592 if (net_ratelimit()) 2589 net_crit_ratelimited("Virtual device %s asks to queue packet!\n",
2593 pr_crit("Virtual device %s asks to queue packet!\n", 2590 dev->name);
2594 dev->name);
2595 } else { 2591 } else {
2596 /* Recursion is detected! It is possible, 2592 /* Recursion is detected! It is possible,
2597 * unfortunately 2593 * unfortunately
2598 */ 2594 */
2599recursion_alert: 2595recursion_alert:
2600 if (net_ratelimit()) 2596 net_crit_ratelimited("Dead loop on virtual device %s, fix it urgently!\n",
2601 pr_crit("Dead loop on virtual device %s, fix it urgently!\n", 2597 dev->name);
2602 dev->name);
2603 } 2598 }
2604 } 2599 }
2605 2600
@@ -3080,9 +3075,8 @@ static int ing_filter(struct sk_buff *skb, struct netdev_queue *rxq)
3080 struct Qdisc *q; 3075 struct Qdisc *q;
3081 3076
3082 if (unlikely(MAX_RED_LOOP < ttl++)) { 3077 if (unlikely(MAX_RED_LOOP < ttl++)) {
3083 if (net_ratelimit()) 3078 net_warn_ratelimited("Redir loop detected Dropping packet (%d->%d)\n",
3084 pr_warn("Redir loop detected Dropping packet (%d->%d)\n", 3079 skb->skb_iif, dev->ifindex);
3085 skb->skb_iif, dev->ifindex);
3086 return TC_ACT_SHOT; 3080 return TC_ACT_SHOT;
3087 } 3081 }
3088 3082
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ffb5d382f24..33912573959 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2934,8 +2934,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2934 2934
2935 if (datalen < sizeof(struct pktgen_hdr)) { 2935 if (datalen < sizeof(struct pktgen_hdr)) {
2936 datalen = sizeof(struct pktgen_hdr); 2936 datalen = sizeof(struct pktgen_hdr);
2937 if (net_ratelimit()) 2937 net_info_ratelimited("increased datalen to %d\n", datalen);
2938 pr_info("increased datalen to %d\n", datalen);
2939 } 2938 }
2940 2939
2941 udph->source = htons(pkt_dev->cur_udp_src); 2940 udph->source = htons(pkt_dev->cur_udp_src);
@@ -3365,8 +3364,8 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
3365 pkt_dev->errors++; 3364 pkt_dev->errors++;
3366 break; 3365 break;
3367 default: /* Drivers are not supposed to return other values! */ 3366 default: /* Drivers are not supposed to return other values! */
3368 if (net_ratelimit()) 3367 net_info_ratelimited("%s xmit error: %d\n",
3369 pr_info("%s xmit error: %d\n", pkt_dev->odevname, ret); 3368 pkt_dev->odevname, ret);
3370 pkt_dev->errors++; 3369 pkt_dev->errors++;
3371 /* fallthru */ 3370 /* fallthru */
3372 case NETDEV_TX_LOCKED: 3371 case NETDEV_TX_LOCKED:
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index b442d35bbc8..21318d15bbc 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -1524,11 +1524,9 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
1524 err = 0; 1524 err = 0;
1525 1525
1526errout: 1526errout:
1527 if (err < 0 && modified && net_ratelimit()) 1527 if (err < 0 && modified)
1528 printk(KERN_WARNING "A link change request failed with " 1528 net_warn_ratelimited("A link change request failed with some changes committed already. Interface %s may have been left with an inconsistent configuration, please check.\n",
1529 "some changes committed already. Interface %s may " 1529 dev->name);
1530 "have been left with an inconsistent configuration, "
1531 "please check.\n", dev->name);
1532 1530
1533 if (send_addr_notify) 1531 if (send_addr_notify)
1534 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); 1532 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 2c35da818ef..2a187194231 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3299,10 +3299,8 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
3299{ 3299{
3300 if (unlikely(start > skb_headlen(skb)) || 3300 if (unlikely(start > skb_headlen(skb)) ||
3301 unlikely((int)start + off > skb_headlen(skb) - 2)) { 3301 unlikely((int)start + off > skb_headlen(skb) - 2)) {
3302 if (net_ratelimit()) 3302 net_warn_ratelimited("bad partial csum: csum=%u/%u len=%u\n",
3303 printk(KERN_WARNING 3303 start, off, skb_headlen(skb));
3304 "bad partial csum: csum=%u/%u len=%u\n",
3305 start, off, skb_headlen(skb));
3306 return false; 3304 return false;
3307 } 3305 }
3308 skb->ip_summed = CHECKSUM_PARTIAL; 3306 skb->ip_summed = CHECKSUM_PARTIAL;
@@ -3314,8 +3312,7 @@ EXPORT_SYMBOL_GPL(skb_partial_csum_set);
3314 3312
3315void __skb_warn_lro_forwarding(const struct sk_buff *skb) 3313void __skb_warn_lro_forwarding(const struct sk_buff *skb)
3316{ 3314{
3317 if (net_ratelimit()) 3315 net_warn_ratelimited("%s: received packets cannot be forwarded while LRO is enabled\n",
3318 pr_warning("%s: received packets cannot be forwarded" 3316 skb->dev->name);
3319 " while LRO is enabled\n", skb->dev->name);
3320} 3317}
3321EXPORT_SYMBOL(__skb_warn_lro_forwarding); 3318EXPORT_SYMBOL(__skb_warn_lro_forwarding);
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 65a8cd7891f..7eaf9879972 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -438,9 +438,8 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowidn
438 res->fi = NULL; 438 res->fi = NULL;
439 return 1; 439 return 1;
440 default: 440 default:
441 if (net_ratelimit()) 441 net_err_ratelimited("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n",
442 printk("DECnet: impossible routing event : dn_fib_semantic_match type=%d\n", 442 type);
443 type);
444 res->fi = NULL; 443 res->fi = NULL;
445 return -EINVAL; 444 return -EINVAL;
446 } 445 }
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index ee7013f24fc..ac90f658586 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -162,8 +162,8 @@ static int dn_neigh_construct(struct neighbour *neigh)
162 else if ((dev->type == ARPHRD_ETHER) || (dev->type == ARPHRD_LOOPBACK)) 162 else if ((dev->type == ARPHRD_ETHER) || (dev->type == ARPHRD_LOOPBACK))
163 dn_dn2eth(neigh->ha, dn->addr); 163 dn_dn2eth(neigh->ha, dn->addr);
164 else { 164 else {
165 if (net_ratelimit()) 165 net_dbg_ratelimited("Trying to create neigh for hw %d\n",
166 printk(KERN_DEBUG "Trying to create neigh for hw %d\n", dev->type); 166 dev->type);
167 return -EINVAL; 167 return -EINVAL;
168 } 168 }
169 169
@@ -236,15 +236,13 @@ static int dn_long_output(struct neighbour *neigh, struct sk_buff *skb)
236 if (skb_headroom(skb) < headroom) { 236 if (skb_headroom(skb) < headroom) {
237 struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); 237 struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
238 if (skb2 == NULL) { 238 if (skb2 == NULL) {
239 if (net_ratelimit()) 239 net_crit_ratelimited("dn_long_output: no memory\n");
240 printk(KERN_CRIT "dn_long_output: no memory\n");
241 kfree_skb(skb); 240 kfree_skb(skb);
242 return -ENOBUFS; 241 return -ENOBUFS;
243 } 242 }
244 kfree_skb(skb); 243 kfree_skb(skb);
245 skb = skb2; 244 skb = skb2;
246 if (net_ratelimit()) 245 net_info_ratelimited("dn_long_output: Increasing headroom\n");
247 printk(KERN_INFO "dn_long_output: Increasing headroom\n");
248 } 246 }
249 247
250 data = skb_push(skb, sizeof(struct dn_long_packet) + 3); 248 data = skb_push(skb, sizeof(struct dn_long_packet) + 3);
@@ -281,15 +279,13 @@ static int dn_short_output(struct neighbour *neigh, struct sk_buff *skb)
281 if (skb_headroom(skb) < headroom) { 279 if (skb_headroom(skb) < headroom) {
282 struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); 280 struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
283 if (skb2 == NULL) { 281 if (skb2 == NULL) {
284 if (net_ratelimit()) 282 net_crit_ratelimited("dn_short_output: no memory\n");
285 printk(KERN_CRIT "dn_short_output: no memory\n");
286 kfree_skb(skb); 283 kfree_skb(skb);
287 return -ENOBUFS; 284 return -ENOBUFS;
288 } 285 }
289 kfree_skb(skb); 286 kfree_skb(skb);
290 skb = skb2; 287 skb = skb2;
291 if (net_ratelimit()) 288 net_info_ratelimited("dn_short_output: Increasing headroom\n");
292 printk(KERN_INFO "dn_short_output: Increasing headroom\n");
293 } 289 }
294 290
295 data = skb_push(skb, sizeof(struct dn_short_packet) + 2); 291 data = skb_push(skb, sizeof(struct dn_short_packet) + 2);
@@ -322,15 +318,13 @@ static int dn_phase3_output(struct neighbour *neigh, struct sk_buff *skb)
322 if (skb_headroom(skb) < headroom) { 318 if (skb_headroom(skb) < headroom) {
323 struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom); 319 struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
324 if (skb2 == NULL) { 320 if (skb2 == NULL) {
325 if (net_ratelimit()) 321 net_crit_ratelimited("dn_phase3_output: no memory\n");
326 printk(KERN_CRIT "dn_phase3_output: no memory\n");
327 kfree_skb(skb); 322 kfree_skb(skb);
328 return -ENOBUFS; 323 return -ENOBUFS;
329 } 324 }
330 kfree_skb(skb); 325 kfree_skb(skb);
331 skb = skb2; 326 skb = skb2;
332 if (net_ratelimit()) 327 net_info_ratelimited("dn_phase3_output: Increasing headroom\n");
333 printk(KERN_INFO "dn_phase3_output: Increasing headroom\n");
334 } 328 }
335 329
336 data = skb_push(skb, sizeof(struct dn_short_packet) + 2); 330 data = skb_push(skb, sizeof(struct dn_short_packet) + 2);
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index 58084f37151..c344163e6ac 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -80,12 +80,15 @@ extern int decnet_log_martians;
80 80
81static void dn_log_martian(struct sk_buff *skb, const char *msg) 81static void dn_log_martian(struct sk_buff *skb, const char *msg)
82{ 82{
83 if (decnet_log_martians && net_ratelimit()) { 83 if (decnet_log_martians) {
84 char *devname = skb->dev ? skb->dev->name : "???"; 84 char *devname = skb->dev ? skb->dev->name : "???";
85 struct dn_skb_cb *cb = DN_SKB_CB(skb); 85 struct dn_skb_cb *cb = DN_SKB_CB(skb);
86 printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", 86 net_info_ratelimited("DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n",
87 msg, devname, le16_to_cpu(cb->src), le16_to_cpu(cb->dst), 87 msg, devname,
88 le16_to_cpu(cb->src_port), le16_to_cpu(cb->dst_port)); 88 le16_to_cpu(cb->src),
89 le16_to_cpu(cb->dst),
90 le16_to_cpu(cb->src_port),
91 le16_to_cpu(cb->dst_port));
89 } 92 }
90} 93}
91 94
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index b952f88d9c1..564a6ad13ce 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -1,4 +1,3 @@
1
2/* 1/*
3 * DECnet An implementation of the DECnet protocol suite for the LINUX 2 * DECnet An implementation of the DECnet protocol suite for the LINUX
4 * operating system. DECnet is implemented using the BSD Socket 3 * operating system. DECnet is implemented using the BSD Socket
@@ -554,8 +553,8 @@ static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
554 unsigned char *msg; 553 unsigned char *msg;
555 554
556 if ((dst == NULL) || (rem == 0)) { 555 if ((dst == NULL) || (rem == 0)) {
557 if (net_ratelimit()) 556 net_dbg_ratelimited("DECnet: dn_nsp_do_disc: BUG! Please report this to SteveW@ACM.org rem=%u dst=%p\n",
558 printk(KERN_DEBUG "DECnet: dn_nsp_do_disc: BUG! Please report this to SteveW@ACM.org rem=%u dst=%p\n", le16_to_cpu(rem), dst); 557 le16_to_cpu(rem), dst);
559 return; 558 return;
560 } 559 }
561 560
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 7e1f8788da1..586302e557a 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -748,8 +748,7 @@ static int dn_output(struct sk_buff *skb)
748 dn_to_neigh_output); 748 dn_to_neigh_output);
749 749
750error: 750error:
751 if (net_ratelimit()) 751 net_dbg_ratelimited("dn_output: This should not happen\n");
752 printk(KERN_DEBUG "dn_output: This should not happen\n");
753 752
754 kfree_skb(skb); 753 kfree_skb(skb);
755 754
@@ -807,12 +806,10 @@ drop:
807 */ 806 */
808static int dn_rt_bug(struct sk_buff *skb) 807static int dn_rt_bug(struct sk_buff *skb)
809{ 808{
810 if (net_ratelimit()) { 809 struct dn_skb_cb *cb = DN_SKB_CB(skb);
811 struct dn_skb_cb *cb = DN_SKB_CB(skb);
812 810
813 printk(KERN_DEBUG "dn_rt_bug: skb from:%04x to:%04x\n", 811 net_dbg_ratelimited("dn_rt_bug: skb from:%04x to:%04x\n",
814 le16_to_cpu(cb->src), le16_to_cpu(cb->dst)); 812 le16_to_cpu(cb->src), le16_to_cpu(cb->dst));
815 }
816 813
817 kfree_skb(skb); 814 kfree_skb(skb);
818 815
@@ -1327,9 +1324,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
1327 1324
1328 out_dev = DN_FIB_RES_DEV(res); 1325 out_dev = DN_FIB_RES_DEV(res);
1329 if (out_dev == NULL) { 1326 if (out_dev == NULL) {
1330 if (net_ratelimit()) 1327 net_crit_ratelimited("Bug in dn_route_input_slow() No output device\n");
1331 printk(KERN_CRIT "Bug in dn_route_input_slow() "
1332 "No output device\n");
1333 goto e_inval; 1328 goto e_inval;
1334 } 1329 }
1335 dev_hold(out_dev); 1330 dev_hold(out_dev);
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index a9a62f225a6..650f3380c98 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -836,8 +836,8 @@ struct dn_fib_table *dn_fib_get_table(u32 n, int create)
836 if (!create) 836 if (!create)
837 return NULL; 837 return NULL;
838 838
839 if (in_interrupt() && net_ratelimit()) { 839 if (in_interrupt()) {
840 printk(KERN_DEBUG "DECnet: BUG! Attempt to create routing table from interrupt\n"); 840 net_dbg_ratelimited("DECnet: BUG! Attempt to create routing table from interrupt\n");
841 return NULL; 841 return NULL;
842 } 842 }
843 843
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index 1531135130d..44b890936fc 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -57,8 +57,7 @@ nlmsg_failure:
57 if (skb) 57 if (skb)
58 kfree_skb(skb); 58 kfree_skb(skb);
59 *errp = -ENOMEM; 59 *errp = -ENOMEM;
60 if (net_ratelimit()) 60 net_err_ratelimited("dn_rtmsg: error creating netlink message\n");
61 printk(KERN_ERR "dn_rtmsg: error creating netlink message\n");
62 return NULL; 61 return NULL;
63} 62}
64 63
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 2cb2bf84564..c75efbdc71c 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -713,11 +713,10 @@ static void icmp_unreach(struct sk_buff *skb)
713 713
714 if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses && 714 if (!net->ipv4.sysctl_icmp_ignore_bogus_error_responses &&
715 inet_addr_type(net, iph->daddr) == RTN_BROADCAST) { 715 inet_addr_type(net, iph->daddr) == RTN_BROADCAST) {
716 if (net_ratelimit()) 716 net_warn_ratelimited("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n",
717 pr_warn("%pI4 sent an invalid ICMP type %u, code %u error to a broadcast: %pI4 on %s\n", 717 &ip_hdr(skb)->saddr,
718 &ip_hdr(skb)->saddr, 718 icmph->type, icmph->code,
719 icmph->type, icmph->code, 719 &iph->daddr, skb->dev->name);
720 &iph->daddr, skb->dev->name);
721 goto out; 720 goto out;
722 } 721 }
723 722
@@ -906,8 +905,7 @@ out_err:
906static void icmp_address(struct sk_buff *skb) 905static void icmp_address(struct sk_buff *skb)
907{ 906{
908#if 0 907#if 0
909 if (net_ratelimit()) 908 net_dbg_ratelimited("a guy asks for address mask. Who is it?\n");
910 printk(KERN_DEBUG "a guy asks for address mask. Who is it?\n");
911#endif 909#endif
912} 910}
913 911
@@ -943,10 +941,10 @@ static void icmp_address_reply(struct sk_buff *skb)
943 inet_ifa_match(ip_hdr(skb)->saddr, ifa)) 941 inet_ifa_match(ip_hdr(skb)->saddr, ifa))
944 break; 942 break;
945 } 943 }
946 if (!ifa && net_ratelimit()) { 944 if (!ifa)
947 pr_info("Wrong address mask %pI4 from %s/%pI4\n", 945 net_info_ratelimited("Wrong address mask %pI4 from %s/%pI4\n",
948 mp, dev->name, &ip_hdr(skb)->saddr); 946 mp,
949 } 947 dev->name, &ip_hdr(skb)->saddr);
950 } 948 }
951} 949}
952 950
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 71e5c328176..9f9bd139335 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -644,8 +644,7 @@ out_nomem:
644 err = -ENOMEM; 644 err = -ENOMEM;
645 goto out_fail; 645 goto out_fail;
646out_oversize: 646out_oversize:
647 if (net_ratelimit()) 647 net_info_ratelimited("Oversized IP packet from %pI4\n", &qp->saddr);
648 pr_info("Oversized IP packet from %pI4\n", &qp->saddr);
649out_fail: 648out_fail:
650 IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); 649 IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS);
651 return err; 650 return err;
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index 26eccc5bab1..8590144ca33 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -210,9 +210,8 @@ static int ip_local_deliver_finish(struct sk_buff *skb)
210 int ret; 210 int ret;
211 211
212 if (!net_eq(net, &init_net) && !ipprot->netns_ok) { 212 if (!net_eq(net, &init_net) && !ipprot->netns_ok) {
213 if (net_ratelimit()) 213 net_info_ratelimited("%s: proto %d isn't netns-ready\n",
214 printk("%s: proto %d isn't netns-ready\n", 214 __func__, protocol);
215 __func__, protocol);
216 kfree_skb(skb); 215 kfree_skb(skb);
217 goto out; 216 goto out;
218 } 217 }
@@ -298,10 +297,10 @@ static inline bool ip_rcv_options(struct sk_buff *skb)
298 297
299 if (in_dev) { 298 if (in_dev) {
300 if (!IN_DEV_SOURCE_ROUTE(in_dev)) { 299 if (!IN_DEV_SOURCE_ROUTE(in_dev)) {
301 if (IN_DEV_LOG_MARTIANS(in_dev) && 300 if (IN_DEV_LOG_MARTIANS(in_dev))
302 net_ratelimit()) 301 net_info_ratelimited("source route option %pI4 -> %pI4\n",
303 pr_info("source route option %pI4 -> %pI4\n", 302 &iph->saddr,
304 &iph->saddr, &iph->daddr); 303 &iph->daddr);
305 goto drop; 304 goto drop;
306 } 305 }
307 } 306 }
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 95722ed0e5b..708b99494e2 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -578,8 +578,10 @@ void ip_forward_options(struct sk_buff *skb)
578 ip_hdr(skb)->daddr = opt->nexthop; 578 ip_hdr(skb)->daddr = opt->nexthop;
579 ip_rt_get_source(&optptr[srrptr-1], skb, rt); 579 ip_rt_get_source(&optptr[srrptr-1], skb, rt);
580 optptr[2] = srrptr+4; 580 optptr[2] = srrptr+4;
581 } else if (net_ratelimit()) 581 } else {
582 pr_crit("%s(): Argh! Destination lost!\n", __func__); 582 net_crit_ratelimited("%s(): Argh! Destination lost!\n",
583 __func__);
584 }
583 if (opt->ts_needaddr) { 585 if (opt->ts_needaddr) {
584 optptr = raw + opt->ts; 586 optptr = raw + opt->ts;
585 ip_rt_get_source(&optptr[optptr[2]-9], skb, rt); 587 ip_rt_get_source(&optptr[optptr[2]-9], skb, rt);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 4910176d24e..451f97c42eb 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -214,8 +214,8 @@ static inline int ip_finish_output2(struct sk_buff *skb)
214 } 214 }
215 rcu_read_unlock(); 215 rcu_read_unlock();
216 216
217 if (net_ratelimit()) 217 net_dbg_ratelimited("%s: No header cache and no neighbour!\n",
218 printk(KERN_DEBUG "ip_finish_output2: No header cache and no neighbour!\n"); 218 __func__);
219 kfree_skb(skb); 219 kfree_skb(skb);
220 return -EINVAL; 220 return -EINVAL;
221} 221}
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index f267280d870..24a3df9890e 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -955,8 +955,7 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
955 955
956 /* Fragments are not supported */ 956 /* Fragments are not supported */
957 if (ip_is_fragment(h)) { 957 if (ip_is_fragment(h)) {
958 if (net_ratelimit()) 958 net_err_ratelimited("DHCP/BOOTP: Ignoring fragmented reply\n");
959 pr_err("DHCP/BOOTP: Ignoring fragmented reply\n");
960 goto drop; 959 goto drop;
961 } 960 }
962 961
@@ -1004,16 +1003,14 @@ static int __init ic_bootp_recv(struct sk_buff *skb, struct net_device *dev, str
1004 /* Is it a reply to our BOOTP request? */ 1003 /* Is it a reply to our BOOTP request? */
1005 if (b->op != BOOTP_REPLY || 1004 if (b->op != BOOTP_REPLY ||
1006 b->xid != d->xid) { 1005 b->xid != d->xid) {
1007 if (net_ratelimit()) 1006 net_err_ratelimited("DHCP/BOOTP: Reply not for us, op[%x] xid[%x]\n",
1008 pr_err("DHCP/BOOTP: Reply not for us, op[%x] xid[%x]\n", 1007 b->op, b->xid);
1009 b->op, b->xid);
1010 goto drop_unlock; 1008 goto drop_unlock;
1011 } 1009 }
1012 1010
1013 /* Is it a reply for the device we are configuring? */ 1011 /* Is it a reply for the device we are configuring? */
1014 if (b->xid != ic_dev_xid) { 1012 if (b->xid != ic_dev_xid) {
1015 if (net_ratelimit()) 1013 net_err_ratelimited("DHCP/BOOTP: Ignoring delayed packet\n");
1016 pr_err("DHCP/BOOTP: Ignoring delayed packet\n");
1017 goto drop_unlock; 1014 goto drop_unlock;
1018 } 1015 }
1019 1016
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 5bef604ac0f..a9e519ad6db 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -949,8 +949,7 @@ static int ipmr_cache_report(struct mr_table *mrt,
949 ret = sock_queue_rcv_skb(mroute_sk, skb); 949 ret = sock_queue_rcv_skb(mroute_sk, skb);
950 rcu_read_unlock(); 950 rcu_read_unlock();
951 if (ret < 0) { 951 if (ret < 0) {
952 if (net_ratelimit()) 952 net_warn_ratelimited("mroute: pending queue full, dropping entries\n");
953 pr_warn("mroute: pending queue full, dropping entries\n");
954 kfree_skb(skb); 953 kfree_skb(skb);
955 } 954 }
956 955
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index a3935273869..97e61eadf58 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -221,9 +221,8 @@ static inline int arp_checkentry(const struct arpt_arp *arp)
221static unsigned int 221static unsigned int
222arpt_error(struct sk_buff *skb, const struct xt_action_param *par) 222arpt_error(struct sk_buff *skb, const struct xt_action_param *par)
223{ 223{
224 if (net_ratelimit()) 224 net_err_ratelimited("arp_tables: error: '%s'\n",
225 pr_err("arp_tables: error: '%s'\n", 225 (const char *)par->targinfo);
226 (const char *)par->targinfo);
227 226
228 return NF_DROP; 227 return NF_DROP;
229} 228}
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 585b80f3cc6..170b1fdd6b7 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -153,8 +153,7 @@ ip_checkentry(const struct ipt_ip *ip)
153static unsigned int 153static unsigned int
154ipt_error(struct sk_buff *skb, const struct xt_action_param *par) 154ipt_error(struct sk_buff *skb, const struct xt_action_param *par)
155{ 155{
156 if (net_ratelimit()) 156 net_info_ratelimited("error: `%s'\n", (const char *)par->targinfo);
157 pr_info("error: `%s'\n", (const char *)par->targinfo);
158 157
159 return NF_DROP; 158 return NF_DROP;
160} 159}
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index a639967eb72..fe5daea5214 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -246,8 +246,7 @@ clusterip_hashfn(const struct sk_buff *skb,
246 dport = ports[1]; 246 dport = ports[1];
247 } 247 }
248 } else { 248 } else {
249 if (net_ratelimit()) 249 net_info_ratelimited("unknown protocol %u\n", iph->protocol);
250 pr_info("unknown protocol %u\n", iph->protocol);
251 } 250 }
252 251
253 switch (config->hash_mode) { 252 switch (config->hash_mode) {
diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c
index 82536701e3a..cad29c12131 100644
--- a/net/ipv4/netfilter/nf_nat_h323.c
+++ b/net/ipv4/netfilter/nf_nat_h323.c
@@ -42,9 +42,7 @@ static int set_addr(struct sk_buff *skb,
42 if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo, 42 if (!nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
43 addroff, sizeof(buf), 43 addroff, sizeof(buf),
44 (char *) &buf, sizeof(buf))) { 44 (char *) &buf, sizeof(buf))) {
45 if (net_ratelimit()) 45 net_notice_ratelimited("nf_nat_h323: nf_nat_mangle_tcp_packet error\n");
46 pr_notice("nf_nat_h323: nf_nat_mangle_tcp_packet"
47 " error\n");
48 return -1; 46 return -1;
49 } 47 }
50 48
@@ -58,9 +56,7 @@ static int set_addr(struct sk_buff *skb,
58 if (!nf_nat_mangle_udp_packet(skb, ct, ctinfo, 56 if (!nf_nat_mangle_udp_packet(skb, ct, ctinfo,
59 addroff, sizeof(buf), 57 addroff, sizeof(buf),
60 (char *) &buf, sizeof(buf))) { 58 (char *) &buf, sizeof(buf))) {
61 if (net_ratelimit()) 59 net_notice_ratelimited("nf_nat_h323: nf_nat_mangle_udp_packet error\n");
62 pr_notice("nf_nat_h323: nf_nat_mangle_udp_packet"
63 " error\n");
64 return -1; 60 return -1;
65 } 61 }
66 /* nf_nat_mangle_udp_packet uses skb_make_writable() to copy 62 /* nf_nat_mangle_udp_packet uses skb_make_writable() to copy
@@ -214,8 +210,7 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
214 210
215 /* Run out of expectations */ 211 /* Run out of expectations */
216 if (i >= H323_RTP_CHANNEL_MAX) { 212 if (i >= H323_RTP_CHANNEL_MAX) {
217 if (net_ratelimit()) 213 net_notice_ratelimited("nf_nat_h323: out of expectations\n");
218 pr_notice("nf_nat_h323: out of expectations\n");
219 return 0; 214 return 0;
220 } 215 }
221 216
@@ -244,8 +239,7 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
244 } 239 }
245 240
246 if (nated_port == 0) { /* No port available */ 241 if (nated_port == 0) { /* No port available */
247 if (net_ratelimit()) 242 net_notice_ratelimited("nf_nat_h323: out of RTP ports\n");
248 pr_notice("nf_nat_h323: out of RTP ports\n");
249 return 0; 243 return 0;
250 } 244 }
251 245
@@ -308,8 +302,7 @@ static int nat_t120(struct sk_buff *skb, struct nf_conn *ct,
308 } 302 }
309 303
310 if (nated_port == 0) { /* No port available */ 304 if (nated_port == 0) { /* No port available */
311 if (net_ratelimit()) 305 net_notice_ratelimited("nf_nat_h323: out of TCP ports\n");
312 pr_notice("nf_nat_h323: out of TCP ports\n");
313 return 0; 306 return 0;
314 } 307 }
315 308
@@ -365,8 +358,7 @@ static int nat_h245(struct sk_buff *skb, struct nf_conn *ct,
365 } 358 }
366 359
367 if (nated_port == 0) { /* No port available */ 360 if (nated_port == 0) { /* No port available */
368 if (net_ratelimit()) 361 net_notice_ratelimited("nf_nat_q931: out of TCP ports\n");
369 pr_notice("nf_nat_q931: out of TCP ports\n");
370 return 0; 362 return 0;
371 } 363 }
372 364
@@ -456,8 +448,7 @@ static int nat_q931(struct sk_buff *skb, struct nf_conn *ct,
456 } 448 }
457 449
458 if (nated_port == 0) { /* No port available */ 450 if (nated_port == 0) { /* No port available */
459 if (net_ratelimit()) 451 net_notice_ratelimited("nf_nat_ras: out of TCP ports\n");
460 pr_notice("nf_nat_ras: out of TCP ports\n");
461 return 0; 452 return 0;
462 } 453 }
463 454
@@ -545,8 +536,7 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
545 } 536 }
546 537
547 if (nated_port == 0) { /* No port available */ 538 if (nated_port == 0) { /* No port available */
548 if (net_ratelimit()) 539 net_notice_ratelimited("nf_nat_q931: out of TCP ports\n");
549 pr_notice("nf_nat_q931: out of TCP ports\n");
550 return 0; 540 return 0;
551 } 541 }
552 542
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c
index 2133c30a4a5..746edec8b86 100644
--- a/net/ipv4/netfilter/nf_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c
@@ -1206,8 +1206,7 @@ static int snmp_translate(struct nf_conn *ct,
1206 1206
1207 if (!snmp_parse_mangle((unsigned char *)udph + sizeof(struct udphdr), 1207 if (!snmp_parse_mangle((unsigned char *)udph + sizeof(struct udphdr),
1208 paylen, &map, &udph->check)) { 1208 paylen, &map, &udph->check)) {
1209 if (net_ratelimit()) 1209 net_warn_ratelimited("bsalg: parser failed\n");
1210 printk(KERN_WARNING "bsalg: parser failed\n");
1211 return NF_DROP; 1210 return NF_DROP;
1212 } 1211 }
1213 return NF_ACCEPT; 1212 return NF_ACCEPT;
@@ -1241,9 +1240,8 @@ static int help(struct sk_buff *skb, unsigned int protoff,
1241 * can mess around with the payload. 1240 * can mess around with the payload.
1242 */ 1241 */
1243 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) { 1242 if (ntohs(udph->len) != skb->len - (iph->ihl << 2)) {
1244 if (net_ratelimit()) 1243 net_warn_ratelimited("SNMP: dropping malformed packet src=%pI4 dst=%pI4\n",
1245 printk(KERN_WARNING "SNMP: dropping malformed packet src=%pI4 dst=%pI4\n", 1244 &iph->saddr, &iph->daddr);
1246 &iph->saddr, &iph->daddr);
1247 return NF_DROP; 1245 return NF_DROP;
1248 } 1246 }
1249 1247
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:
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 86e2cf2ff77..feb2e25091b 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1745,9 +1745,9 @@ do_prequeue:
1745 } 1745 }
1746 if ((flags & MSG_PEEK) && 1746 if ((flags & MSG_PEEK) &&
1747 (peek_seq - copied - urg_hole != tp->copied_seq)) { 1747 (peek_seq - copied - urg_hole != tp->copied_seq)) {
1748 if (net_ratelimit()) 1748 net_dbg_ratelimited("TCP(%s:%d): Application bug, race in MSG_PEEK\n",
1749 printk(KERN_DEBUG "TCP(%s:%d): Application bug, race in MSG_PEEK.\n", 1749 current->comm,
1750 current->comm, task_pid_nr(current)); 1750 task_pid_nr(current));
1751 peek_seq = tp->copied_seq; 1751 peek_seq = tp->copied_seq;
1752 } 1752 }
1753 continue; 1753 continue;
@@ -2002,10 +2002,10 @@ bool tcp_check_oom(struct sock *sk, int shift)
2002 too_many_orphans = tcp_too_many_orphans(sk, shift); 2002 too_many_orphans = tcp_too_many_orphans(sk, shift);
2003 out_of_socket_memory = tcp_out_of_memory(sk); 2003 out_of_socket_memory = tcp_out_of_memory(sk);
2004 2004
2005 if (too_many_orphans && net_ratelimit()) 2005 if (too_many_orphans)
2006 pr_info("too many orphaned sockets\n"); 2006 net_info_ratelimited("too many orphaned sockets\n");
2007 if (out_of_socket_memory && net_ratelimit()) 2007 if (out_of_socket_memory)
2008 pr_info("out of memory -- consider tuning tcp_mem\n"); 2008 net_info_ratelimited("out of memory -- consider tuning tcp_mem\n");
2009 return too_many_orphans || out_of_socket_memory; 2009 return too_many_orphans || out_of_socket_memory;
2010} 2010}
2011 2011
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b99ada27a13..100b242135b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3952,10 +3952,9 @@ void tcp_parse_options(const struct sk_buff *skb, struct tcp_options_received *o
3952 __u8 snd_wscale = *(__u8 *)ptr; 3952 __u8 snd_wscale = *(__u8 *)ptr;
3953 opt_rx->wscale_ok = 1; 3953 opt_rx->wscale_ok = 1;
3954 if (snd_wscale > 14) { 3954 if (snd_wscale > 14) {
3955 if (net_ratelimit()) 3955 net_info_ratelimited("%s: Illegal window scaling value %d >14 received\n",
3956 pr_info("%s: Illegal window scaling value %d >14 received\n", 3956 __func__,
3957 __func__, 3957 snd_wscale);
3958 snd_wscale);
3959 snd_wscale = 14; 3958 snd_wscale = 14;
3960 } 3959 }
3961 opt_rx->snd_wscale = snd_wscale; 3960 opt_rx->snd_wscale = snd_wscale;
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 4ff5e1f70d1..2e76ffb66d7 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1239,12 +1239,11 @@ static int tcp_v4_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb)
1239 NULL, NULL, skb); 1239 NULL, NULL, skb);
1240 1240
1241 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 1241 if (genhash || memcmp(hash_location, newhash, 16) != 0) {
1242 if (net_ratelimit()) { 1242 net_info_ratelimited("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n",
1243 pr_info("MD5 Hash failed for (%pI4, %d)->(%pI4, %d)%s\n", 1243 &iph->saddr, ntohs(th->source),
1244 &iph->saddr, ntohs(th->source), 1244 &iph->daddr, ntohs(th->dest),
1245 &iph->daddr, ntohs(th->dest), 1245 genhash ? " tcp_v4_calc_md5_hash failed"
1246 genhash ? " tcp_v4_calc_md5_hash failed" : ""); 1246 : "");
1247 }
1248 return 1; 1247 return 1;
1249 } 1248 }
1250 return 0; 1249 return 0;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index d9473300992..7979bfd5d0f 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2181,8 +2181,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
2181 2181
2182#if FASTRETRANS_DEBUG > 0 2182#if FASTRETRANS_DEBUG > 0
2183 if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) { 2183 if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) {
2184 if (net_ratelimit()) 2184 net_dbg_ratelimited("retrans_out leaked\n");
2185 printk(KERN_DEBUG "retrans_out leaked.\n");
2186 } 2185 }
2187#endif 2186#endif
2188 if (!tp->retrans_out) 2187 if (!tp->retrans_out)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8b7f100a4b4..4d1d51a0bd2 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1415,9 +1415,8 @@ void addrconf_dad_failure(struct inet6_ifaddr *ifp)
1415 return; 1415 return;
1416 } 1416 }
1417 1417
1418 if (net_ratelimit()) 1418 net_info_ratelimited("%s: IPv6 duplicate address %pI6c detected!\n",
1419 printk(KERN_INFO "%s: IPv6 duplicate address %pI6c detected!\n", 1419 ifp->idev->dev->name, &ifp->addr);
1420 ifp->idev->dev->name, &ifp->addr);
1421 1420
1422 if (idev->cnf.accept_dad > 1 && !idev->cnf.disable_ipv6) { 1421 if (idev->cnf.accept_dad > 1 && !idev->cnf.disable_ipv6) {
1423 struct in6_addr addr; 1422 struct in6_addr addr;
@@ -1847,16 +1846,15 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
1847 prefered_lft = ntohl(pinfo->prefered); 1846 prefered_lft = ntohl(pinfo->prefered);
1848 1847
1849 if (prefered_lft > valid_lft) { 1848 if (prefered_lft > valid_lft) {
1850 if (net_ratelimit()) 1849 net_warn_ratelimited("addrconf: prefix option has invalid lifetime\n");
1851 printk(KERN_WARNING "addrconf: prefix option has invalid lifetime\n");
1852 return; 1850 return;
1853 } 1851 }
1854 1852
1855 in6_dev = in6_dev_get(dev); 1853 in6_dev = in6_dev_get(dev);
1856 1854
1857 if (in6_dev == NULL) { 1855 if (in6_dev == NULL) {
1858 if (net_ratelimit()) 1856 net_dbg_ratelimited("addrconf: device %s not configured\n",
1859 printk(KERN_DEBUG "addrconf: device %s not configured\n", dev->name); 1857 dev->name);
1860 return; 1858 return;
1861 } 1859 }
1862 1860
@@ -1931,9 +1929,8 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
1931 } 1929 }
1932 goto ok; 1930 goto ok;
1933 } 1931 }
1934 if (net_ratelimit()) 1932 net_dbg_ratelimited("IPv6 addrconf: prefix with wrong length %d\n",
1935 printk(KERN_DEBUG "IPv6 addrconf: prefix with wrong length %d\n", 1933 pinfo->prefix_len);
1936 pinfo->prefix_len);
1937 in6_dev_put(in6_dev); 1934 in6_dev_put(in6_dev);
1938 return; 1935 return;
1939 1936
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 2ae79dbeec2..a9f4156f7c3 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -189,8 +189,8 @@ static void ipv6_rearrange_destopt(struct ipv6hdr *iph, struct ipv6_opt_hdr *des
189 189
190 hao = (struct ipv6_destopt_hao *)&opt[off]; 190 hao = (struct ipv6_destopt_hao *)&opt[off];
191 if (hao->length != sizeof(hao->addr)) { 191 if (hao->length != sizeof(hao->addr)) {
192 if (net_ratelimit()) 192 net_warn_ratelimited("destopt hao: invalid header length: %u\n",
193 printk(KERN_WARNING "destopt hao: invalid header length: %u\n", hao->length); 193 hao->length);
194 goto bad; 194 goto bad;
195 } 195 }
196 final_addr = hao->addr; 196 final_addr = hao->addr;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index d8e05af2c4b..be2264e7dd2 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -252,8 +252,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6,
252 dst->dev, dst_output); 252 dst->dev, dst_output);
253 } 253 }
254 254
255 if (net_ratelimit()) 255 net_dbg_ratelimited("IPv6: sending pkt_too_big to self\n");
256 printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
257 skb->dev = dst->dev; 256 skb->dev = dst->dev;
258 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu); 257 icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
259 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); 258 IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 5df487c81ed..27fec272d39 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);
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index efc0098b59d..ba936e18b61 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1147,8 +1147,7 @@ static int ip6mr_cache_report(struct mr6_table *mrt, struct sk_buff *pkt,
1147 */ 1147 */
1148 ret = sock_queue_rcv_skb(mrt->mroute6_sk, skb); 1148 ret = sock_queue_rcv_skb(mrt->mroute6_sk, skb);
1149 if (ret < 0) { 1149 if (ret < 0) {
1150 if (net_ratelimit()) 1150 net_warn_ratelimited("mroute6: pending queue full, dropping entries\n");
1151 printk(KERN_WARNING "mroute6: pending queue full, dropping entries.\n");
1152 kfree_skb(skb); 1151 kfree_skb(skb);
1153 } 1152 }
1154 1153
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 308bdd65123..d7cb04506c3 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -181,8 +181,7 @@ ip6_checkentry(const struct ip6t_ip6 *ipv6)
181static unsigned int 181static unsigned int
182ip6t_error(struct sk_buff *skb, const struct xt_action_param *par) 182ip6t_error(struct sk_buff *skb, const struct xt_action_param *par)
183{ 183{
184 if (net_ratelimit()) 184 net_info_ratelimited("error: `%s'\n", (const char *)par->targinfo);
185 pr_info("error: `%s'\n", (const char *)par->targinfo);
186 185
187 return NF_DROP; 186 return NF_DROP;
188} 187}
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
index aad2fa41cf4..fd4fb34c51c 100644
--- a/net/ipv6/netfilter/ip6t_REJECT.c
+++ b/net/ipv6/netfilter/ip6t_REJECT.c
@@ -114,8 +114,7 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
114 GFP_ATOMIC); 114 GFP_ATOMIC);
115 115
116 if (!nskb) { 116 if (!nskb) {
117 if (net_ratelimit()) 117 net_dbg_ratelimited("cannot alloc skb\n");
118 pr_debug("cannot alloc skb\n");
119 dst_release(dst); 118 dst_release(dst);
120 return; 119 return;
121 } 120 }
@@ -210,8 +209,7 @@ reject_tg6(struct sk_buff *skb, const struct xt_action_param *par)
210 send_reset(net, skb); 209 send_reset(net, skb);
211 break; 210 break;
212 default: 211 default:
213 if (net_ratelimit()) 212 net_info_ratelimited("case %u not handled yet\n", reject->with);
214 pr_info("case %u not handled yet\n", reject->with);
215 break; 213 break;
216 } 214 }
217 215
diff --git a/net/ipv6/netfilter/ip6table_mangle.c b/net/ipv6/netfilter/ip6table_mangle.c
index 00d19173db7..4d782405f12 100644
--- a/net/ipv6/netfilter/ip6table_mangle.c
+++ b/net/ipv6/netfilter/ip6table_mangle.c
@@ -42,8 +42,7 @@ ip6t_mangle_out(struct sk_buff *skb, const struct net_device *out)
42 /* root is playing with raw sockets. */ 42 /* root is playing with raw sockets. */
43 if (skb->len < sizeof(struct iphdr) || 43 if (skb->len < sizeof(struct iphdr) ||
44 ip_hdrlen(skb) < sizeof(struct iphdr)) { 44 ip_hdrlen(skb) < sizeof(struct iphdr)) {
45 if (net_ratelimit()) 45 net_warn_ratelimited("ip6t_hook: happy cracking\n");
46 pr_warning("ip6t_hook: happy cracking.\n");
47 return NF_ACCEPT; 46 return NF_ACCEPT;
48 } 47 }
49#endif 48#endif
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index fe925e49252..3224ef90a21 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -232,8 +232,7 @@ static unsigned int ipv6_conntrack_local(unsigned int hooknum,
232{ 232{
233 /* root is playing with raw sockets. */ 233 /* root is playing with raw sockets. */
234 if (skb->len < sizeof(struct ipv6hdr)) { 234 if (skb->len < sizeof(struct ipv6hdr)) {
235 if (net_ratelimit()) 235 net_notice_ratelimited("ipv6_conntrack_local: packet too short\n");
236 pr_notice("ipv6_conntrack_local: packet too short\n");
237 return NF_ACCEPT; 236 return NF_ACCEPT;
238 } 237 }
239 return __ipv6_conntrack_in(dev_net(out), hooknum, skb, okfn); 238 return __ipv6_conntrack_in(dev_net(out), hooknum, skb, okfn);
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 48a2be1b7c7..c9c78c2e666 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -444,12 +444,11 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
444 return head; 444 return head;
445 445
446out_oversize: 446out_oversize:
447 if (net_ratelimit()) 447 net_dbg_ratelimited("nf_ct_frag6_reasm: payload len = %d\n",
448 printk(KERN_DEBUG "nf_ct_frag6_reasm: payload len = %d\n", payload_len); 448 payload_len);
449 goto out_fail; 449 goto out_fail;
450out_oom: 450out_oom:
451 if (net_ratelimit()) 451 net_dbg_ratelimited("nf_ct_frag6_reasm: no memory for reassembly\n");
452 printk(KERN_DEBUG "nf_ct_frag6_reasm: no memory for reassembly\n");
453out_fail: 452out_fail:
454 return NULL; 453 return NULL;
455} 454}
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 54c5d2b704d..f1b86fdc06a 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -518,12 +518,10 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
518 return 1; 518 return 1;
519 519
520out_oversize: 520out_oversize:
521 if (net_ratelimit()) 521 net_dbg_ratelimited("ip6_frag_reasm: payload len = %d\n", payload_len);
522 printk(KERN_DEBUG "ip6_frag_reasm: payload len = %d\n", payload_len);
523 goto out_fail; 522 goto out_fail;
524out_oom: 523out_oom:
525 if (net_ratelimit()) 524 net_dbg_ratelimited("ip6_frag_reasm: no memory for reassembly\n");
526 printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
527out_fail: 525out_fail:
528 rcu_read_lock(); 526 rcu_read_lock();
529 IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS); 527 IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 0aefc36f74c..e20e3206902 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -794,9 +794,7 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort,
794 goto retry; 794 goto retry;
795 } 795 }
796 796
797 if (net_ratelimit()) 797 net_warn_ratelimited("ipv6: Neighbour table overflow\n");
798 printk(KERN_WARNING
799 "ipv6: Neighbour table overflow.\n");
800 dst_free(&rt->dst); 798 dst_free(&rt->dst);
801 return NULL; 799 return NULL;
802 } 800 }
@@ -1643,9 +1641,7 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
1643 rt = ip6_route_redirect(dest, src, saddr, neigh->dev); 1641 rt = ip6_route_redirect(dest, src, saddr, neigh->dev);
1644 1642
1645 if (rt == net->ipv6.ip6_null_entry) { 1643 if (rt == net->ipv6.ip6_null_entry) {
1646 if (net_ratelimit()) 1644 net_dbg_ratelimited("rt6_redirect: source isn't a valid nexthop for redirect target\n");
1647 printk(KERN_DEBUG "rt6_redirect: source isn't a valid nexthop "
1648 "for redirect target\n");
1649 goto out; 1645 goto out;
1650 } 1646 }
1651 1647
@@ -2106,9 +2102,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
2106 int err; 2102 int err;
2107 2103
2108 if (!rt) { 2104 if (!rt) {
2109 if (net_ratelimit()) 2105 net_warn_ratelimited("IPv6: Maximum number of routes reached, consider increasing route/max_size\n");
2110 pr_warning("IPv6: Maximum number of routes reached,"
2111 " consider increasing route/max_size.\n");
2112 return ERR_PTR(-ENOMEM); 2106 return ERR_PTR(-ENOMEM);
2113 } 2107 }
2114 2108
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index e5fef943e30..a36a09701bf 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -702,8 +702,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
702 neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr); 702 neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr);
703 703
704 if (neigh == NULL) { 704 if (neigh == NULL) {
705 if (net_ratelimit()) 705 net_dbg_ratelimited("sit: nexthop == NULL\n");
706 printk(KERN_DEBUG "sit: nexthop == NULL\n");
707 goto tx_error; 706 goto tx_error;
708 } 707 }
709 708
@@ -732,8 +731,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
732 neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr); 731 neigh = dst_neigh_lookup(skb_dst(skb), &iph6->daddr);
733 732
734 if (neigh == NULL) { 733 if (neigh == NULL) {
735 if (net_ratelimit()) 734 net_dbg_ratelimited("sit: nexthop == NULL\n");
736 printk(KERN_DEBUG "sit: nexthop == NULL\n");
737 goto tx_error; 735 goto tx_error;
738 } 736 }
739 737
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 078d039e8fd..4cf55ae7bf8 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -723,12 +723,10 @@ static int tcp_v6_inbound_md5_hash(struct sock *sk, const struct sk_buff *skb)
723 NULL, NULL, skb); 723 NULL, NULL, skb);
724 724
725 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 725 if (genhash || memcmp(hash_location, newhash, 16) != 0) {
726 if (net_ratelimit()) { 726 net_info_ratelimited("MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n",
727 printk(KERN_INFO "MD5 Hash %s for [%pI6c]:%u->[%pI6c]:%u\n", 727 genhash ? "failed" : "mismatch",
728 genhash ? "failed" : "mismatch", 728 &ip6h->saddr, ntohs(th->source),
729 &ip6h->saddr, ntohs(th->source), 729 &ip6h->daddr, ntohs(th->dest));
730 &ip6h->daddr, ntohs(th->dest));
731 }
732 return 1; 730 return 1;
733 } 731 }
734 return 0; 732 return 0;
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 17bc85d5b7b..78424f41cf3 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -806,10 +806,9 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
806 sk_wait_data(sk, &timeo); 806 sk_wait_data(sk, &timeo);
807 807
808 if ((flags & MSG_PEEK) && peek_seq != llc->copied_seq) { 808 if ((flags & MSG_PEEK) && peek_seq != llc->copied_seq) {
809 if (net_ratelimit()) 809 net_dbg_ratelimited("LLC(%s:%d): Application bug, race in MSG_PEEK\n",
810 printk(KERN_DEBUG "LLC(%s:%d): Application " 810 current->comm,
811 "bug, race in MSG_PEEK.\n", 811 task_pid_nr(current));
812 current->comm, task_pid_nr(current));
813 peek_seq = llc->copied_seq; 812 peek_seq = llc->copied_seq;
814 } 813 }
815 continue; 814 continue;
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index a070d4f460e..26ddb699d69 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -260,11 +260,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
260 (buf_size > IEEE80211_MAX_AMPDU_BUF)) { 260 (buf_size > IEEE80211_MAX_AMPDU_BUF)) {
261 status = WLAN_STATUS_INVALID_QOS_PARAM; 261 status = WLAN_STATUS_INVALID_QOS_PARAM;
262#ifdef CONFIG_MAC80211_HT_DEBUG 262#ifdef CONFIG_MAC80211_HT_DEBUG
263 if (net_ratelimit()) 263 net_dbg_ratelimited("AddBA Req with bad params from %pM on tid %u. policy %d, buffer size %d\n",
264 printk(KERN_DEBUG "AddBA Req with bad params from " 264 mgmt->sa, tid, ba_policy, buf_size);
265 "%pM on tid %u. policy %d, buffer size %d\n",
266 mgmt->sa, tid, ba_policy,
267 buf_size);
268#endif /* CONFIG_MAC80211_HT_DEBUG */ 265#endif /* CONFIG_MAC80211_HT_DEBUG */
269 goto end_no_lock; 266 goto end_no_lock;
270 } 267 }
@@ -281,10 +278,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
281 278
282 if (sta->ampdu_mlme.tid_rx[tid]) { 279 if (sta->ampdu_mlme.tid_rx[tid]) {
283#ifdef CONFIG_MAC80211_HT_DEBUG 280#ifdef CONFIG_MAC80211_HT_DEBUG
284 if (net_ratelimit()) 281 net_dbg_ratelimited("unexpected AddBA Req from %pM on tid %u\n",
285 printk(KERN_DEBUG "unexpected AddBA Req from " 282 mgmt->sa, tid);
286 "%pM on tid %u\n",
287 mgmt->sa, tid);
288#endif /* CONFIG_MAC80211_HT_DEBUG */ 283#endif /* CONFIG_MAC80211_HT_DEBUG */
289 284
290 /* delete existing Rx BA session on the same tid */ 285 /* delete existing Rx BA session on the same tid */
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 9b603366943..6f8615c54b2 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -306,10 +306,10 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
306 initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11; 306 initiator = (params & IEEE80211_DELBA_PARAM_INITIATOR_MASK) >> 11;
307 307
308#ifdef CONFIG_MAC80211_HT_DEBUG 308#ifdef CONFIG_MAC80211_HT_DEBUG
309 if (net_ratelimit()) 309 net_dbg_ratelimited("delba from %pM (%s) tid %d reason code %d\n",
310 printk(KERN_DEBUG "delba from %pM (%s) tid %d reason code %d\n", 310 mgmt->sa, initiator ? "initiator" : "recipient",
311 mgmt->sa, initiator ? "initiator" : "recipient", tid, 311 tid,
312 le16_to_cpu(mgmt->u.action.u.delba.reason_code)); 312 le16_to_cpu(mgmt->u.action.u.delba.reason_code));
313#endif /* CONFIG_MAC80211_HT_DEBUG */ 313#endif /* CONFIG_MAC80211_HT_DEBUG */
314 314
315 if (initiator == WLAN_BACK_INITIATOR) 315 if (initiator == WLAN_BACK_INITIATOR)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index ebafba61c2f..3ad33a82462 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -303,9 +303,8 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
303 * allow new one to be added. 303 * allow new one to be added.
304 */ 304 */
305 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 305 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
306 if (net_ratelimit()) 306 net_dbg_ratelimited("%s: No room for a new IBSS STA entry %pM\n",
307 printk(KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n", 307 sdata->name, addr);
308 sdata->name, addr);
309 rcu_read_lock(); 308 rcu_read_lock();
310 return NULL; 309 return NULL;
311 } 310 }
@@ -582,9 +581,8 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
582 * allow new one to be added. 581 * allow new one to be added.
583 */ 582 */
584 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 583 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
585 if (net_ratelimit()) 584 net_dbg_ratelimited("%s: No room for a new IBSS STA entry %pM\n",
586 printk(KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n", 585 sdata->name, addr);
587 sdata->name, addr);
588 return; 586 return;
589 } 587 }
590 588
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 52cd301245a..b3b3c264ff6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1567,9 +1567,9 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
1567 } 1567 }
1568 1568
1569#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1569#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1570 if (beacon && net_ratelimit()) 1570 if (beacon)
1571 printk(KERN_DEBUG "%s: detected beacon loss from AP " 1571 net_dbg_ratelimited("%s: detected beacon loss from AP - sending probe request\n",
1572 "- sending probe request\n", sdata->name); 1572 sdata->name);
1573#endif 1573#endif
1574 1574
1575 /* 1575 /*
@@ -2404,10 +2404,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2404 2404
2405 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) { 2405 if (ifmgd->flags & IEEE80211_STA_BEACON_POLL) {
2406#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2406#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
2407 if (net_ratelimit()) { 2407 net_dbg_ratelimited("%s: cancelling probereq poll due to a received beacon\n",
2408 printk(KERN_DEBUG "%s: cancelling probereq poll due " 2408 sdata->name);
2409 "to a received beacon\n", sdata->name);
2410 }
2411#endif 2409#endif
2412 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL; 2410 ifmgd->flags &= ~IEEE80211_STA_BEACON_POLL;
2413 mutex_lock(&local->iflist_mtx); 2411 mutex_lock(&local->iflist_mtx);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index d722c40c7ec..8257a09eeed 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1752,9 +1752,9 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1752 * local net stack and back to the wireless medium 1752 * local net stack and back to the wireless medium
1753 */ 1753 */
1754 xmit_skb = skb_copy(skb, GFP_ATOMIC); 1754 xmit_skb = skb_copy(skb, GFP_ATOMIC);
1755 if (!xmit_skb && net_ratelimit()) 1755 if (!xmit_skb)
1756 printk(KERN_DEBUG "%s: failed to clone " 1756 net_dbg_ratelimited("%s: failed to clone multicast frame\n",
1757 "multicast frame\n", dev->name); 1757 dev->name);
1758 } else { 1758 } else {
1759 dsta = sta_info_get(sdata, skb->data); 1759 dsta = sta_info_get(sdata, skb->data);
1760 if (dsta) { 1760 if (dsta) {
@@ -1957,9 +1957,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1957 1957
1958 fwd_skb = skb_copy(skb, GFP_ATOMIC); 1958 fwd_skb = skb_copy(skb, GFP_ATOMIC);
1959 if (!fwd_skb) { 1959 if (!fwd_skb) {
1960 if (net_ratelimit()) 1960 net_dbg_ratelimited("%s: failed to clone mesh frame\n",
1961 printk(KERN_DEBUG "%s: failed to clone mesh frame\n", 1961 sdata->name);
1962 sdata->name);
1963 goto out; 1962 goto out;
1964 } 1963 }
1965 1964
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e03abc78ee5..5f827a6b0d8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -413,9 +413,8 @@ ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx)
413 413
414 if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= AP_MAX_BC_BUFFER) { 414 if (skb_queue_len(&tx->sdata->bss->ps_bc_buf) >= AP_MAX_BC_BUFFER) {
415#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 415#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
416 if (net_ratelimit()) 416 net_dbg_ratelimited("%s: BC TX buffer full - dropping the oldest frame\n",
417 printk(KERN_DEBUG "%s: BC TX buffer full - dropping the oldest frame\n", 417 tx->sdata->name);
418 tx->sdata->name);
419#endif 418#endif
420 dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf)); 419 dev_kfree_skb(skb_dequeue(&tx->sdata->bss->ps_bc_buf));
421 } else 420 } else
@@ -476,10 +475,8 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
476 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) { 475 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) {
477 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]); 476 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]);
478#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 477#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
479 if (net_ratelimit()) 478 net_dbg_ratelimited("%s: STA %pM TX buffer for AC %d full - dropping oldest frame\n",
480 printk(KERN_DEBUG "%s: STA %pM TX buffer for " 479 tx->sdata->name, sta->sta.addr, ac);
481 "AC %d full - dropping oldest frame\n",
482 tx->sdata->name, sta->sta.addr, ac);
483#endif 480#endif
484 dev_kfree_skb(old); 481 dev_kfree_skb(old);
485 } else 482 } else
@@ -1965,10 +1962,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1965 (cpu_to_be16(ethertype) != sdata->control_port_protocol || 1962 (cpu_to_be16(ethertype) != sdata->control_port_protocol ||
1966 !ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN)))) { 1963 !ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN)))) {
1967#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1964#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1968 if (net_ratelimit()) 1965 net_dbg_ratelimited("%s: dropped frame to %pM (unauthorized port)\n",
1969 printk(KERN_DEBUG "%s: dropped frame to %pM" 1966 dev->name, hdr.addr1);
1970 " (unauthorized port)\n", dev->name,
1971 hdr.addr1);
1972#endif 1967#endif
1973 1968
1974 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port); 1969 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port);
diff --git a/net/netfilter/nf_conntrack_amanda.c b/net/netfilter/nf_conntrack_amanda.c
index 13fd2c55e32..f2de8c55ac5 100644
--- a/net/netfilter/nf_conntrack_amanda.c
+++ b/net/netfilter/nf_conntrack_amanda.c
@@ -107,8 +107,7 @@ static int amanda_help(struct sk_buff *skb,
107 /* No data? */ 107 /* No data? */
108 dataoff = protoff + sizeof(struct udphdr); 108 dataoff = protoff + sizeof(struct udphdr);
109 if (dataoff >= skb->len) { 109 if (dataoff >= skb->len) {
110 if (net_ratelimit()) 110 net_err_ratelimited("amanda_help: skblen = %u\n", skb->len);
111 printk(KERN_ERR "amanda_help: skblen = %u\n", skb->len);
112 return NF_ACCEPT; 111 return NF_ACCEPT;
113 } 112 }
114 113
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 32c59093146..ac3af97cc46 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -683,10 +683,7 @@ __nf_conntrack_alloc(struct net *net, u16 zone,
683 unlikely(atomic_read(&net->ct.count) > nf_conntrack_max)) { 683 unlikely(atomic_read(&net->ct.count) > nf_conntrack_max)) {
684 if (!early_drop(net, hash_bucket(hash, net))) { 684 if (!early_drop(net, hash_bucket(hash, net))) {
685 atomic_dec(&net->ct.count); 685 atomic_dec(&net->ct.count);
686 if (net_ratelimit()) 686 net_warn_ratelimited("nf_conntrack: table full, dropping packet\n");
687 printk(KERN_WARNING
688 "nf_conntrack: table full, dropping"
689 " packet.\n");
690 return ERR_PTR(-ENOMEM); 687 return ERR_PTR(-ENOMEM);
691 } 688 }
692 } 689 }
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index 4147ba3f653..45cf602a76b 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -424,9 +424,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
424 } 424 }
425 425
426 if (net->ct.expect_count >= nf_ct_expect_max) { 426 if (net->ct.expect_count >= nf_ct_expect_max) {
427 if (net_ratelimit()) 427 net_warn_ratelimited("nf_conntrack: expectation table full\n");
428 printk(KERN_WARNING
429 "nf_conntrack: expectation table full\n");
430 ret = -EMFILE; 428 ret = -EMFILE;
431 } 429 }
432out: 430out:
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index 471b054ad00..93c13eb67b3 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -605,8 +605,7 @@ static int h245_help(struct sk_buff *skb, unsigned int protoff,
605 605
606 drop: 606 drop:
607 spin_unlock_bh(&nf_h323_lock); 607 spin_unlock_bh(&nf_h323_lock);
608 if (net_ratelimit()) 608 net_info_ratelimited("nf_ct_h245: packet dropped\n");
609 pr_info("nf_ct_h245: packet dropped\n");
610 return NF_DROP; 609 return NF_DROP;
611} 610}
612 611
@@ -1156,8 +1155,7 @@ static int q931_help(struct sk_buff *skb, unsigned int protoff,
1156 1155
1157 drop: 1156 drop:
1158 spin_unlock_bh(&nf_h323_lock); 1157 spin_unlock_bh(&nf_h323_lock);
1159 if (net_ratelimit()) 1158 net_info_ratelimited("nf_ct_q931: packet dropped\n");
1160 pr_info("nf_ct_q931: packet dropped\n");
1161 return NF_DROP; 1159 return NF_DROP;
1162} 1160}
1163 1161
@@ -1731,8 +1729,7 @@ static int ras_help(struct sk_buff *skb, unsigned int protoff,
1731 1729
1732 drop: 1730 drop:
1733 spin_unlock_bh(&nf_h323_lock); 1731 spin_unlock_bh(&nf_h323_lock);
1734 if (net_ratelimit()) 1732 net_info_ratelimited("nf_ct_ras: packet dropped\n");
1735 pr_info("nf_ct_ras: packet dropped\n");
1736 return NF_DROP; 1733 return NF_DROP;
1737} 1734}
1738 1735
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
index 4f9390b9869..81366c11827 100644
--- a/net/netfilter/nf_conntrack_irc.c
+++ b/net/netfilter/nf_conntrack_irc.c
@@ -185,11 +185,9 @@ static int help(struct sk_buff *skb, unsigned int protoff,
185 tuple = &ct->tuplehash[dir].tuple; 185 tuple = &ct->tuplehash[dir].tuple;
186 if (tuple->src.u3.ip != dcc_ip && 186 if (tuple->src.u3.ip != dcc_ip &&
187 tuple->dst.u3.ip != dcc_ip) { 187 tuple->dst.u3.ip != dcc_ip) {
188 if (net_ratelimit()) 188 net_warn_ratelimited("Forged DCC command from %pI4: %pI4:%u\n",
189 printk(KERN_WARNING 189 &tuple->src.u3.ip,
190 "Forged DCC command from %pI4: %pI4:%u\n", 190 &dcc_ip, dcc_port);
191 &tuple->src.u3.ip,
192 &dcc_ip, dcc_port);
193 continue; 191 continue;
194 } 192 }
195 193
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 8d6bcf32c0e..4162437b836 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -395,8 +395,7 @@ nlmsg_failure:
395nla_put_failure: 395nla_put_failure:
396 if (skb) 396 if (skb)
397 kfree_skb(skb); 397 kfree_skb(skb);
398 if (net_ratelimit()) 398 net_err_ratelimited("nf_queue: error creating packet message\n");
399 printk(KERN_ERR "nf_queue: error creating packet message\n");
400 return NULL; 399 return NULL;
401} 400}
402 401
@@ -433,10 +432,8 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
433 } 432 }
434 if (queue->queue_total >= queue->queue_maxlen) { 433 if (queue->queue_total >= queue->queue_maxlen) {
435 queue->queue_dropped++; 434 queue->queue_dropped++;
436 if (net_ratelimit()) 435 net_warn_ratelimited("nf_queue: full at %d entries, dropping packets(s)\n",
437 printk(KERN_WARNING "nf_queue: full at %d entries, " 436 queue->queue_total);
438 "dropping packets(s).\n",
439 queue->queue_total);
440 goto err_out_free_nskb; 437 goto err_out_free_nskb;
441 } 438 }
442 entry->id = ++queue->id_sequence; 439 entry->id = ++queue->id_sequence;
diff --git a/net/netfilter/xt_TCPMSS.c b/net/netfilter/xt_TCPMSS.c
index 190ad37c5cf..71a266de5fb 100644
--- a/net/netfilter/xt_TCPMSS.c
+++ b/net/netfilter/xt_TCPMSS.c
@@ -67,15 +67,13 @@ tcpmss_mangle_packet(struct sk_buff *skb,
67 67
68 if (info->mss == XT_TCPMSS_CLAMP_PMTU) { 68 if (info->mss == XT_TCPMSS_CLAMP_PMTU) {
69 if (dst_mtu(skb_dst(skb)) <= minlen) { 69 if (dst_mtu(skb_dst(skb)) <= minlen) {
70 if (net_ratelimit()) 70 net_err_ratelimited("unknown or invalid path-MTU (%u)\n",
71 pr_err("unknown or invalid path-MTU (%u)\n", 71 dst_mtu(skb_dst(skb)));
72 dst_mtu(skb_dst(skb)));
73 return -1; 72 return -1;
74 } 73 }
75 if (in_mtu <= minlen) { 74 if (in_mtu <= minlen) {
76 if (net_ratelimit()) 75 net_err_ratelimited("unknown or invalid path-MTU (%u)\n",
77 pr_err("unknown or invalid path-MTU (%u)\n", 76 in_mtu);
78 in_mtu);
79 return -1; 77 return -1;
80 } 78 }
81 newmss = min(dst_mtu(skb_dst(skb)), in_mtu) - minlen; 79 newmss = min(dst_mtu(skb_dst(skb)), in_mtu) - minlen;
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index d0424f9621f..5d5af1d04fa 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -171,8 +171,7 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht,
171 171
172 if (ht->cfg.max && ht->count >= ht->cfg.max) { 172 if (ht->cfg.max && ht->count >= ht->cfg.max) {
173 /* FIXME: do something. question is what.. */ 173 /* FIXME: do something. question is what.. */
174 if (net_ratelimit()) 174 net_err_ratelimited("max count of %u reached\n", ht->cfg.max);
175 pr_err("max count of %u reached\n", ht->cfg.max);
176 ent = NULL; 175 ent = NULL;
177 } else 176 } else
178 ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC); 177 ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC);
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
index 5920bda4ab6..3fd6c0d88e1 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -157,9 +157,9 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb)
157 int len; 157 int len;
158 158
159 if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) { 159 if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) {
160 if (net_ratelimit()) 160 net_warn_ratelimited("%s: dropped over-mtu packet: %d > %d\n",
161 pr_warn("%s: dropped over-mtu packet: %d > %d\n", 161 ovs_dp_name(vport->dp),
162 ovs_dp_name(vport->dp), packet_length(skb), mtu); 162 packet_length(skb), mtu);
163 goto error; 163 goto error;
164 } 164 }
165 165
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 0beba0e5312..60e281ad0f0 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * net/sched/ipt.c iptables target interface 2 * net/sched/ipt.c iptables target interface
3 * 3 *
4 *TODO: Add other tables. For now we only support the ipv4 table targets 4 *TODO: Add other tables. For now we only support the ipv4 table targets
5 * 5 *
@@ -235,9 +235,8 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
235 result = TC_ACT_PIPE; 235 result = TC_ACT_PIPE;
236 break; 236 break;
237 default: 237 default:
238 if (net_ratelimit()) 238 net_notice_ratelimited("tc filter: Bogus netfilter code %d assume ACCEPT\n",
239 pr_notice("tc filter: Bogus netfilter code" 239 ret);
240 " %d assume ACCEPT\n", ret);
241 result = TC_POLICE_OK; 240 result = TC_POLICE_OK;
242 break; 241 break;
243 } 242 }
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index d583aea3b3d..fe81cc18e9e 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -174,9 +174,8 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
174 } 174 }
175 175
176 if (!(dev->flags & IFF_UP)) { 176 if (!(dev->flags & IFF_UP)) {
177 if (net_ratelimit()) 177 net_notice_ratelimited("tc mirred to Houston: device %s is down\n",
178 pr_notice("tc mirred to Houston: device %s is down\n", 178 dev->name);
179 dev->name);
180 goto out; 179 goto out;
181 } 180 }
182 181
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 591b006a8c5..d45373fb00b 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -234,8 +234,7 @@ out:
234 return -1; 234 return -1;
235 235
236deadloop: 236deadloop:
237 if (net_ratelimit()) 237 net_warn_ratelimited("cls_u32: dead loop\n");
238 pr_warning("cls_u32: dead loop\n");
239 return -1; 238 return -1;
240} 239}
241 240
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index aca233c2b84..3a633debb6d 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -537,9 +537,7 @@ pop_stack:
537 return res; 537 return res;
538 538
539stack_overflow: 539stack_overflow:
540 if (net_ratelimit()) 540 net_warn_ratelimited("tc ematch: local stack overflow, increase NET_EMATCH_STACK\n");
541 pr_warning("tc ematch: local stack overflow,"
542 " increase NET_EMATCH_STACK\n");
543 return -1; 541 return -1;
544} 542}
545EXPORT_SYMBOL(__tcf_em_tree_match); 543EXPORT_SYMBOL(__tcf_em_tree_match);
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index d2daefcc205..085ce53d570 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1691,12 +1691,10 @@ reclassify:
1691 tp = otp; 1691 tp = otp;
1692 1692
1693 if (verd++ >= MAX_REC_LOOP) { 1693 if (verd++ >= MAX_REC_LOOP) {
1694 if (net_ratelimit()) 1694 net_notice_ratelimited("%s: packet reclassify loop rule prio %u protocol %02x\n",
1695 pr_notice("%s: packet reclassify loop" 1695 tp->q->ops->id,
1696 " rule prio %u protocol %02x\n", 1696 tp->prio & 0xffff,
1697 tp->q->ops->id, 1697 ntohs(tp->protocol));
1698 tp->prio & 0xffff,
1699 ntohs(tp->protocol));
1700 return TC_ACT_SHOT; 1698 return TC_ACT_SHOT;
1701 } 1699 }
1702 skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd); 1700 skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 0eb1202c22a..511323e89ce 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -86,9 +86,8 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
86 * deadloop is detected. Return OK to try the next skb. 86 * deadloop is detected. Return OK to try the next skb.
87 */ 87 */
88 kfree_skb(skb); 88 kfree_skb(skb);
89 if (net_ratelimit()) 89 net_warn_ratelimited("Dead loop on netdevice %s, fix it urgently!\n",
90 pr_warning("Dead loop on netdevice %s, fix it urgently!\n", 90 dev_queue->dev->name);
91 dev_queue->dev->name);
92 ret = qdisc_qlen(q); 91 ret = qdisc_qlen(q);
93 } else { 92 } else {
94 /* 93 /*
@@ -136,9 +135,9 @@ int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
136 ret = handle_dev_cpu_collision(skb, txq, q); 135 ret = handle_dev_cpu_collision(skb, txq, q);
137 } else { 136 } else {
138 /* Driver returned NETDEV_TX_BUSY - requeue skb */ 137 /* Driver returned NETDEV_TX_BUSY - requeue skb */
139 if (unlikely (ret != NETDEV_TX_BUSY && net_ratelimit())) 138 if (unlikely(ret != NETDEV_TX_BUSY))
140 pr_warning("BUG %s code %d qlen %d\n", 139 net_warn_ratelimited("BUG %s code %d qlen %d\n",
141 dev->name, ret, q->q.qlen); 140 dev->name, ret, q->q.qlen);
142 141
143 ret = dev_requeue_skb(skb, q); 142 ret = dev_requeue_skb(skb, q);
144 } 143 }
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index ab620bf9078..e901583e4ea 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -255,10 +255,8 @@ static struct sk_buff *gred_dequeue(struct Qdisc *sch)
255 u16 dp = tc_index_to_dp(skb); 255 u16 dp = tc_index_to_dp(skb);
256 256
257 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { 257 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
258 if (net_ratelimit()) 258 net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x after dequeue, screwing up backlog\n",
259 pr_warning("GRED: Unable to relocate VQ 0x%x " 259 tc_index_to_dp(skb));
260 "after dequeue, screwing up "
261 "backlog.\n", tc_index_to_dp(skb));
262 } else { 260 } else {
263 q->backlog -= qdisc_pkt_len(skb); 261 q->backlog -= qdisc_pkt_len(skb);
264 262
@@ -287,10 +285,8 @@ static unsigned int gred_drop(struct Qdisc *sch)
287 u16 dp = tc_index_to_dp(skb); 285 u16 dp = tc_index_to_dp(skb);
288 286
289 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { 287 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
290 if (net_ratelimit()) 288 net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x while dropping, screwing up backlog\n",
291 pr_warning("GRED: Unable to relocate VQ 0x%x " 289 tc_index_to_dp(skb));
292 "while dropping, screwing up "
293 "backlog.\n", tc_index_to_dp(skb));
294 } else { 290 } else {
295 q->backlog -= len; 291 q->backlog -= len;
296 q->stats.other++; 292 q->stats.other++;
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index fbb374c6594..c96d1a81cf4 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1161,9 +1161,8 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
1161 break; 1161 break;
1162 1162
1163 case SCTP_DISPOSITION_VIOLATION: 1163 case SCTP_DISPOSITION_VIOLATION:
1164 if (net_ratelimit()) 1164 net_err_ratelimited("protocol violation state %d chunkid %d\n",
1165 pr_err("protocol violation state %d chunkid %d\n", 1165 state, subtype.chunk);
1166 state, subtype.chunk);
1167 break; 1166 break;
1168 1167
1169 case SCTP_DISPOSITION_NOT_IMPL: 1168 case SCTP_DISPOSITION_NOT_IMPL:
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index a147b4d307d..9fca1035735 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1129,17 +1129,15 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1129 /* This should never happen, but lets log it if so. */ 1129 /* This should never happen, but lets log it if so. */
1130 if (unlikely(!link)) { 1130 if (unlikely(!link)) {
1131 if (from_addr.sa.sa_family == AF_INET6) { 1131 if (from_addr.sa.sa_family == AF_INET6) {
1132 if (net_ratelimit()) 1132 net_warn_ratelimited("%s association %p could not find address %pI6\n",
1133 pr_warn("%s association %p could not find address %pI6\n", 1133 __func__,
1134 __func__, 1134 asoc,
1135 asoc, 1135 &from_addr.v6.sin6_addr);
1136 &from_addr.v6.sin6_addr);
1137 } else { 1136 } else {
1138 if (net_ratelimit()) 1137 net_warn_ratelimited("%s association %p could not find address %pI4\n",
1139 pr_warn("%s association %p could not find address %pI4\n", 1138 __func__,
1140 __func__, 1139 asoc,
1141 asoc, 1140 &from_addr.v4.sin_addr.s_addr);
1142 &from_addr.v4.sin_addr.s_addr);
1143 } 1141 }
1144 return SCTP_DISPOSITION_DISCARD; 1142 return SCTP_DISPOSITION_DISCARD;
1145 } 1143 }
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 92ba71dfe08..b3b8a8d813e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5840,10 +5840,8 @@ SCTP_STATIC int sctp_listen_start(struct sock *sk, int backlog)
5840 if (!sctp_sk(sk)->hmac && sctp_hmac_alg) { 5840 if (!sctp_sk(sk)->hmac && sctp_hmac_alg) {
5841 tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC); 5841 tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC);
5842 if (IS_ERR(tfm)) { 5842 if (IS_ERR(tfm)) {
5843 if (net_ratelimit()) { 5843 net_info_ratelimited("failed to load transform for %s: %ld\n",
5844 pr_info("failed to load transform for %s: %ld\n", 5844 sctp_hmac_alg, PTR_ERR(tfm));
5845 sctp_hmac_alg, PTR_ERR(tfm));
5846 }
5847 return -ENOSYS; 5845 return -ENOSYS;
5848 } 5846 }
5849 sctp_sk(sk)->hmac = tfm; 5847 sctp_sk(sk)->hmac = tfm;
diff --git a/net/socket.c b/net/socket.c
index d3aaa4f67a3..2a2898ce596 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -1234,8 +1234,7 @@ int __sock_create(struct net *net, int family, int type, int protocol,
1234 */ 1234 */
1235 sock = sock_alloc(); 1235 sock = sock_alloc();
1236 if (!sock) { 1236 if (!sock) {
1237 if (net_ratelimit()) 1237 net_warn_ratelimited("socket: no more sockets\n");
1238 printk(KERN_WARNING "socket: no more sockets\n");
1239 return -ENFILE; /* Not exactly a match, but its the 1238 return -ENFILE; /* Not exactly a match, but its the
1240 closest posix thing */ 1239 closest posix thing */
1241 } 1240 }
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 4153846984a..017c0117d15 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1041,23 +1041,21 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net)
1041 * Printk the given error with the address of the client that caused it. 1041 * Printk the given error with the address of the client that caused it.
1042 */ 1042 */
1043static __printf(2, 3) 1043static __printf(2, 3)
1044int svc_printk(struct svc_rqst *rqstp, const char *fmt, ...) 1044void svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
1045{ 1045{
1046 struct va_format vaf;
1046 va_list args; 1047 va_list args;
1047 int r;
1048 char buf[RPC_MAX_ADDRBUFLEN]; 1048 char buf[RPC_MAX_ADDRBUFLEN];
1049 1049
1050 if (!net_ratelimit()) 1050 va_start(args, fmt);
1051 return 0;
1052 1051
1053 printk(KERN_WARNING "svc: %s: ", 1052 vaf.fmt = fmt;
1054 svc_print_addr(rqstp, buf, sizeof(buf))); 1053 vaf.va = &args;
1055 1054
1056 va_start(args, fmt); 1055 net_warn_ratelimited("svc: %s: %pV",
1057 r = vprintk(fmt, args); 1056 svc_print_addr(rqstp, buf, sizeof(buf)), &vaf);
1058 va_end(args);
1059 1057
1060 return r; 1058 va_end(args);
1061} 1059}
1062 1060
1063/* 1061/*
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 4bda09d7e1a..b98ee351491 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -544,14 +544,11 @@ static void svc_check_conn_limits(struct svc_serv *serv)
544 struct svc_xprt *xprt = NULL; 544 struct svc_xprt *xprt = NULL;
545 spin_lock_bh(&serv->sv_lock); 545 spin_lock_bh(&serv->sv_lock);
546 if (!list_empty(&serv->sv_tempsocks)) { 546 if (!list_empty(&serv->sv_tempsocks)) {
547 if (net_ratelimit()) { 547 /* Try to help the admin */
548 /* Try to help the admin */ 548 net_notice_ratelimited("%s: too many open connections, consider increasing the %s\n",
549 printk(KERN_NOTICE "%s: too many open " 549 serv->sv_name, serv->sv_maxconn ?
550 "connections, consider increasing %s\n", 550 "max number of connections" :
551 serv->sv_name, serv->sv_maxconn ? 551 "number of threads");
552 "the max number of connections." :
553 "the number of threads.");
554 }
555 /* 552 /*
556 * Always select the oldest connection. It's not fair, 553 * Always select the oldest connection. It's not fair,
557 * but so is life 554 * but so is life
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index f0132b2e875..a6de09de5d2 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -617,11 +617,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
617 rqstp->rq_prot = IPPROTO_UDP; 617 rqstp->rq_prot = IPPROTO_UDP;
618 618
619 if (!svc_udp_get_dest_address(rqstp, cmh)) { 619 if (!svc_udp_get_dest_address(rqstp, cmh)) {
620 if (net_ratelimit()) 620 net_warn_ratelimited("svc: received unknown control message %d/%d; dropping RPC reply datagram\n",
621 printk(KERN_WARNING 621 cmh->cmsg_level, cmh->cmsg_type);
622 "svc: received unknown control message %d/%d; "
623 "dropping RPC reply datagram\n",
624 cmh->cmsg_level, cmh->cmsg_type);
625 skb_free_datagram_locked(svsk->sk_sk, skb); 622 skb_free_datagram_locked(svsk->sk_sk, skb);
626 return 0; 623 return 0;
627 } 624 }
@@ -871,18 +868,17 @@ static struct svc_xprt *svc_tcp_accept(struct svc_xprt *xprt)
871 if (err == -ENOMEM) 868 if (err == -ENOMEM)
872 printk(KERN_WARNING "%s: no more sockets!\n", 869 printk(KERN_WARNING "%s: no more sockets!\n",
873 serv->sv_name); 870 serv->sv_name);
874 else if (err != -EAGAIN && net_ratelimit()) 871 else if (err != -EAGAIN)
875 printk(KERN_WARNING "%s: accept failed (err %d)!\n", 872 net_warn_ratelimited("%s: accept failed (err %d)!\n",
876 serv->sv_name, -err); 873 serv->sv_name, -err);
877 return NULL; 874 return NULL;
878 } 875 }
879 set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags); 876 set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags);
880 877
881 err = kernel_getpeername(newsock, sin, &slen); 878 err = kernel_getpeername(newsock, sin, &slen);
882 if (err < 0) { 879 if (err < 0) {
883 if (net_ratelimit()) 880 net_warn_ratelimited("%s: peername failed (err %d)!\n",
884 printk(KERN_WARNING "%s: peername failed (err %d)!\n", 881 serv->sv_name, -err);
885 serv->sv_name, -err);
886 goto failed; /* aborted connection or whatever */ 882 goto failed; /* aborted connection or whatever */
887 } 883 }
888 884
@@ -1012,19 +1008,15 @@ static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp)
1012 * bit set in the fragment length header. 1008 * bit set in the fragment length header.
1013 * But apparently no known nfs clients send fragmented 1009 * But apparently no known nfs clients send fragmented
1014 * records. */ 1010 * records. */
1015 if (net_ratelimit()) 1011 net_notice_ratelimited("RPC: multiple fragments per record not supported\n");
1016 printk(KERN_NOTICE "RPC: multiple fragments "
1017 "per record not supported\n");
1018 goto err_delete; 1012 goto err_delete;
1019 } 1013 }
1020 1014
1021 svsk->sk_reclen &= RPC_FRAGMENT_SIZE_MASK; 1015 svsk->sk_reclen &= RPC_FRAGMENT_SIZE_MASK;
1022 dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen); 1016 dprintk("svc: TCP record, %d bytes\n", svsk->sk_reclen);
1023 if (svsk->sk_reclen > serv->sv_max_mesg) { 1017 if (svsk->sk_reclen > serv->sv_max_mesg) {
1024 if (net_ratelimit()) 1018 net_notice_ratelimited("RPC: fragment too large: 0x%08lx\n",
1025 printk(KERN_NOTICE "RPC: " 1019 (unsigned long)svsk->sk_reclen);
1026 "fragment too large: 0x%08lx\n",
1027 (unsigned long)svsk->sk_reclen);
1028 goto err_delete; 1020 goto err_delete;
1029 } 1021 }
1030 } 1022 }
diff --git a/net/wireless/lib80211_crypt_ccmp.c b/net/wireless/lib80211_crypt_ccmp.c
index 755738d26bb..1526c211db6 100644
--- a/net/wireless/lib80211_crypt_ccmp.c
+++ b/net/wireless/lib80211_crypt_ccmp.c
@@ -304,10 +304,8 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
304 pos = skb->data + hdr_len; 304 pos = skb->data + hdr_len;
305 keyidx = pos[3]; 305 keyidx = pos[3];
306 if (!(keyidx & (1 << 5))) { 306 if (!(keyidx & (1 << 5))) {
307 if (net_ratelimit()) { 307 net_dbg_ratelimited("CCMP: received packet without ExtIV flag from %pM\n",
308 printk(KERN_DEBUG "CCMP: received packet without ExtIV" 308 hdr->addr2);
309 " flag from %pM\n", hdr->addr2);
310 }
311 key->dot11RSNAStatsCCMPFormatErrors++; 309 key->dot11RSNAStatsCCMPFormatErrors++;
312 return -2; 310 return -2;
313 } 311 }
@@ -318,11 +316,8 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
318 return -6; 316 return -6;
319 } 317 }
320 if (!key->key_set) { 318 if (!key->key_set) {
321 if (net_ratelimit()) { 319 net_dbg_ratelimited("CCMP: received packet from %pM with keyid=%d that does not have a configured key\n",
322 printk(KERN_DEBUG "CCMP: received packet from %pM" 320 hdr->addr2, keyidx);
323 " with keyid=%d that does not have a configured"
324 " key\n", hdr->addr2, keyidx);
325 }
326 return -3; 321 return -3;
327 } 322 }
328 323
@@ -336,15 +331,11 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
336 331
337 if (ccmp_replay_check(pn, key->rx_pn)) { 332 if (ccmp_replay_check(pn, key->rx_pn)) {
338#ifdef CONFIG_LIB80211_DEBUG 333#ifdef CONFIG_LIB80211_DEBUG
339 if (net_ratelimit()) { 334 net_dbg_ratelimited("CCMP: replay detected: STA=%pM previous PN %02x%02x%02x%02x%02x%02x received PN %02x%02x%02x%02x%02x%02x\n",
340 printk(KERN_DEBUG "CCMP: replay detected: STA=%pM " 335 hdr->addr2,
341 "previous PN %02x%02x%02x%02x%02x%02x " 336 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2],
342 "received PN %02x%02x%02x%02x%02x%02x\n", 337 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
343 hdr->addr2, 338 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
344 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2],
345 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
346 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
347 }
348#endif 339#endif
349 key->dot11RSNAStatsCCMPReplays++; 340 key->dot11RSNAStatsCCMPReplays++;
350 return -4; 341 return -4;
@@ -370,10 +361,8 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
370 } 361 }
371 362
372 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) { 363 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
373 if (net_ratelimit()) { 364 net_dbg_ratelimited("CCMP: decrypt failed: STA=%pM\n",
374 printk(KERN_DEBUG "CCMP: decrypt failed: STA=" 365 hdr->addr2);
375 "%pM\n", hdr->addr2);
376 }
377 key->dot11RSNAStatsCCMPDecryptErrors++; 366 key->dot11RSNAStatsCCMPDecryptErrors++;
378 return -5; 367 return -5;
379 } 368 }
diff --git a/net/wireless/lib80211_crypt_tkip.c b/net/wireless/lib80211_crypt_tkip.c
index 38734846c19..d475cfc8568 100644
--- a/net/wireless/lib80211_crypt_tkip.c
+++ b/net/wireless/lib80211_crypt_tkip.c
@@ -360,12 +360,9 @@ static int lib80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
360 struct scatterlist sg; 360 struct scatterlist sg;
361 361
362 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { 362 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
363 if (net_ratelimit()) { 363 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
364 struct ieee80211_hdr *hdr = 364 net_dbg_ratelimited("TKIP countermeasures: dropped TX packet to %pM\n",
365 (struct ieee80211_hdr *)skb->data; 365 hdr->addr1);
366 printk(KERN_DEBUG ": TKIP countermeasures: dropped "
367 "TX packet to %pM\n", hdr->addr1);
368 }
369 return -1; 366 return -1;
370 } 367 }
371 368
@@ -420,10 +417,8 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
420 hdr = (struct ieee80211_hdr *)skb->data; 417 hdr = (struct ieee80211_hdr *)skb->data;
421 418
422 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { 419 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
423 if (net_ratelimit()) { 420 net_dbg_ratelimited("TKIP countermeasures: dropped received packet from %pM\n",
424 printk(KERN_DEBUG ": TKIP countermeasures: dropped " 421 hdr->addr2);
425 "received packet from %pM\n", hdr->addr2);
426 }
427 return -1; 422 return -1;
428 } 423 }
429 424
@@ -433,10 +428,8 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
433 pos = skb->data + hdr_len; 428 pos = skb->data + hdr_len;
434 keyidx = pos[3]; 429 keyidx = pos[3];
435 if (!(keyidx & (1 << 5))) { 430 if (!(keyidx & (1 << 5))) {
436 if (net_ratelimit()) { 431 net_dbg_ratelimited("TKIP: received packet without ExtIV flag from %pM\n",
437 printk(KERN_DEBUG "TKIP: received packet without ExtIV" 432 hdr->addr2);
438 " flag from %pM\n", hdr->addr2);
439 }
440 return -2; 433 return -2;
441 } 434 }
442 keyidx >>= 6; 435 keyidx >>= 6;
@@ -446,11 +439,8 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
446 return -6; 439 return -6;
447 } 440 }
448 if (!tkey->key_set) { 441 if (!tkey->key_set) {
449 if (net_ratelimit()) { 442 net_dbg_ratelimited("TKIP: received packet from %pM with keyid=%d that does not have a configured key\n",
450 printk(KERN_DEBUG "TKIP: received packet from %pM" 443 hdr->addr2, keyidx);
451 " with keyid=%d that does not have a configured"
452 " key\n", hdr->addr2, keyidx);
453 }
454 return -3; 444 return -3;
455 } 445 }
456 iv16 = (pos[0] << 8) | pos[2]; 446 iv16 = (pos[0] << 8) | pos[2];
@@ -459,12 +449,9 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
459 449
460 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { 450 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
461#ifdef CONFIG_LIB80211_DEBUG 451#ifdef CONFIG_LIB80211_DEBUG
462 if (net_ratelimit()) { 452 net_dbg_ratelimited("TKIP: replay detected: STA=%pM previous TSC %08x%04x received TSC %08x%04x\n",
463 printk(KERN_DEBUG "TKIP: replay detected: STA=%pM" 453 hdr->addr2, tkey->rx_iv32, tkey->rx_iv16,
464 " previous TSC %08x%04x received TSC " 454 iv32, iv16);
465 "%08x%04x\n", hdr->addr2,
466 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
467 }
468#endif 455#endif
469 tkey->dot11RSNAStatsTKIPReplays++; 456 tkey->dot11RSNAStatsTKIPReplays++;
470 return -4; 457 return -4;
@@ -481,11 +468,8 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
481 crypto_blkcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16); 468 crypto_blkcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16);
482 sg_init_one(&sg, pos, plen + 4); 469 sg_init_one(&sg, pos, plen + 4);
483 if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { 470 if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) {
484 if (net_ratelimit()) { 471 net_dbg_ratelimited("TKIP: failed to decrypt received packet from %pM\n",
485 printk(KERN_DEBUG ": TKIP: failed to decrypt " 472 hdr->addr2);
486 "received packet from %pM\n",
487 hdr->addr2);
488 }
489 return -7; 473 return -7;
490 } 474 }
491 475
@@ -501,10 +485,8 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
501 tkey->rx_phase1_done = 0; 485 tkey->rx_phase1_done = 0;
502 } 486 }
503#ifdef CONFIG_LIB80211_DEBUG 487#ifdef CONFIG_LIB80211_DEBUG
504 if (net_ratelimit()) { 488 net_dbg_ratelimited("TKIP: ICV error detected: STA=%pM\n",
505 printk(KERN_DEBUG "TKIP: ICV error detected: STA=" 489 hdr->addr2);
506 "%pM\n", hdr->addr2);
507 }
508#endif 490#endif
509 tkey->dot11RSNAStatsTKIPICVErrors++; 491 tkey->dot11RSNAStatsTKIPICVErrors++;
510 return -5; 492 return -5;