aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-03-12 03:03:32 -0400
committerDavid S. Miller <davem@davemloft.net>2012-03-12 20:05:21 -0400
commitafd465030acb4098abcb6b965a5aebc7ea2209e0 (patch)
tree59c93e8eda99cd59339dfbb77f1d2c4f79c634ee /net/ipv4
parent058bd4d2a4ff0aaa4a5381c67e776729d840c785 (diff)
net: ipv4: Standardize prefixes for message logging
Add #define pr_fmt(fmt) as appropriate. Add "IPv4: ", "TCP: ", and "IPsec: " to appropriate files. Standardize on "UDPLite: " for appropriate uses. Some prefixes were previously "UDPLITE: " and "UDP-Lite: ". Add KBUILD_MODNAME ": " to icmp and gre. Remove embedded prefixes as appropriate. Add missing "\n" to pr_info in gre.c. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/ah4.c9
-rw-r--r--net/ipv4/esp4.c2
-rw-r--r--net/ipv4/gre.c6
-rw-r--r--net/ipv4/icmp.c6
-rw-r--r--net/ipv4/ip_fragment.c8
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_input.c2
-rw-r--r--net/ipv4/ip_options.c2
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv4/tcp.c11
-rw-r--r--net/ipv4/tcp_cong.c8
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/tcp_ipv4.c6
-rw-r--r--net/ipv4/tcp_probe.c4
-rw-r--r--net/ipv4/tcp_timer.c14
-rw-r--r--net/ipv4/udp.c34
-rw-r--r--net/ipv4/udplite.c3
-rw-r--r--net/ipv4/xfrm4_tunnel.c2
19 files changed, 79 insertions, 48 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index b7a946611f2f..fdf49fd44bb4 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -65,6 +65,8 @@
65 * 2 of the License, or (at your option) any later version. 65 * 2 of the License, or (at your option) any later version.
66 */ 66 */
67 67
68#define pr_fmt(fmt) "IPv4: " fmt
69
68#include <linux/err.h> 70#include <linux/err.h>
69#include <linux/errno.h> 71#include <linux/errno.h>
70#include <linux/types.h> 72#include <linux/types.h>
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index b5524660c81d..fd508b526014 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -1,3 +1,5 @@
1#define pr_fmt(fmt) "IPsec: " fmt
2
1#include <crypto/hash.h> 3#include <crypto/hash.h>
2#include <linux/err.h> 4#include <linux/err.h>
3#include <linux/module.h> 5#include <linux/module.h>
@@ -445,9 +447,10 @@ static int ah_init_state(struct xfrm_state *x)
445 447
446 if (aalg_desc->uinfo.auth.icv_fullbits/8 != 448 if (aalg_desc->uinfo.auth.icv_fullbits/8 !=
447 crypto_ahash_digestsize(ahash)) { 449 crypto_ahash_digestsize(ahash)) {
448 pr_info("AH: %s digestsize %u != %hu\n", 450 pr_info("%s: %s digestsize %u != %hu\n",
449 x->aalg->alg_name, crypto_ahash_digestsize(ahash), 451 __func__, x->aalg->alg_name,
450 aalg_desc->uinfo.auth.icv_fullbits/8); 452 crypto_ahash_digestsize(ahash),
453 aalg_desc->uinfo.auth.icv_fullbits / 8);
451 goto error; 454 goto error;
452 } 455 }
453 456
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 0a86dbe9454b..89a47b35905d 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -1,3 +1,5 @@
1#define pr_fmt(fmt) "IPsec: " fmt
2
1#include <crypto/aead.h> 3#include <crypto/aead.h>
2#include <crypto/authenc.h> 4#include <crypto/authenc.h>
3#include <linux/err.h> 5#include <linux/err.h>
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index 8cb1ebb7cd74..42a491055c76 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -10,6 +10,8 @@
10 * 10 *
11 */ 11 */
12 12
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14
13#include <linux/module.h> 15#include <linux/module.h>
14#include <linux/kernel.h> 16#include <linux/kernel.h>
15#include <linux/kmod.h> 17#include <linux/kmod.h>
@@ -118,10 +120,10 @@ static const struct net_protocol net_gre_protocol = {
118 120
119static int __init gre_init(void) 121static int __init gre_init(void)
120{ 122{
121 pr_info("GRE over IPv4 demultiplexor driver"); 123 pr_info("GRE over IPv4 demultiplexor driver\n");
122 124
123 if (inet_add_protocol(&net_gre_protocol, IPPROTO_GRE) < 0) { 125 if (inet_add_protocol(&net_gre_protocol, IPPROTO_GRE) < 0) {
124 pr_err("gre: can't add protocol\n"); 126 pr_err("can't add protocol\n");
125 return -EAGAIN; 127 return -EAGAIN;
126 } 128 }
127 129
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 5c7323b7810f..9664d353ccd8 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -62,6 +62,8 @@
62 * 62 *
63 */ 63 */
64 64
65#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
66
65#include <linux/module.h> 67#include <linux/module.h>
66#include <linux/types.h> 68#include <linux/types.h>
67#include <linux/jiffies.h> 69#include <linux/jiffies.h>
@@ -670,7 +672,7 @@ static void icmp_unreach(struct sk_buff *skb)
670 break; 672 break;
671 case ICMP_FRAG_NEEDED: 673 case ICMP_FRAG_NEEDED:
672 if (ipv4_config.no_pmtu_disc) { 674 if (ipv4_config.no_pmtu_disc) {
673 LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: fragmentation needed and DF set\n", 675 LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: fragmentation needed and DF set\n"),
674 &iph->daddr); 676 &iph->daddr);
675 } else { 677 } else {
676 info = ip_rt_frag_needed(net, iph, 678 info = ip_rt_frag_needed(net, iph,
@@ -681,7 +683,7 @@ static void icmp_unreach(struct sk_buff *skb)
681 } 683 }
682 break; 684 break;
683 case ICMP_SR_FAILED: 685 case ICMP_SR_FAILED:
684 LIMIT_NETDEBUG(KERN_INFO "ICMP: %pI4: Source Route Failed\n", 686 LIMIT_NETDEBUG(KERN_INFO pr_fmt("%pI4: Source Route Failed\n"),
685 &iph->daddr); 687 &iph->daddr);
686 break; 688 break;
687 default: 689 default:
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index b2fd333abd59..3727e234c884 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -20,6 +20,8 @@
20 * Patrick McHardy : LRU queue of frag heads for evictor. 20 * Patrick McHardy : LRU queue of frag heads for evictor.
21 */ 21 */
22 22
23#define pr_fmt(fmt) "IPv4: " fmt
24
23#include <linux/compiler.h> 25#include <linux/compiler.h>
24#include <linux/module.h> 26#include <linux/module.h>
25#include <linux/types.h> 27#include <linux/types.h>
@@ -299,7 +301,7 @@ static inline struct ipq *ip_find(struct net *net, struct iphdr *iph, u32 user)
299 return container_of(q, struct ipq, q); 301 return container_of(q, struct ipq, q);
300 302
301out_nomem: 303out_nomem:
302 LIMIT_NETDEBUG(KERN_ERR "ip_frag_create: no memory left !\n"); 304 LIMIT_NETDEBUG(KERN_ERR pr_fmt("ip_frag_create: no memory left !\n"));
303 return NULL; 305 return NULL;
304} 306}
305 307
@@ -637,8 +639,8 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
637 return 0; 639 return 0;
638 640
639out_nomem: 641out_nomem:
640 LIMIT_NETDEBUG(KERN_ERR "IP: queue_glue: no memory for gluing " 642 LIMIT_NETDEBUG(KERN_ERR pr_fmt("queue_glue: no memory for gluing queue %p\n"),
641 "queue %p\n", qp); 643 qp);
642 err = -ENOMEM; 644 err = -ENOMEM;
643 goto out_fail; 645 goto out_fail;
644out_oversize: 646out_oversize:
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 185e0a75ecec..b57532d4742c 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -10,6 +10,8 @@
10 * 10 *
11 */ 11 */
12 12
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14
13#include <linux/capability.h> 15#include <linux/capability.h>
14#include <linux/module.h> 16#include <linux/module.h>
15#include <linux/types.h> 17#include <linux/types.h>
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index de8e9be4aac8..f3f1108940f5 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -113,6 +113,8 @@
113 * 2 of the License, or (at your option) any later version. 113 * 2 of the License, or (at your option) any later version.
114 */ 114 */
115 115
116#define pr_fmt(fmt) "IPv4: " fmt
117
116#include <asm/system.h> 118#include <asm/system.h>
117#include <linux/module.h> 119#include <linux/module.h>
118#include <linux/types.h> 120#include <linux/types.h>
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index e25ee7c8bdde..a0d0d9d9b870 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -9,6 +9,8 @@
9 * 9 *
10 */ 10 */
11 11
12#define pr_fmt(fmt) "IPv4: " fmt
13
12#include <linux/capability.h> 14#include <linux/capability.h>
13#include <linux/module.h> 15#include <linux/module.h>
14#include <linux/slab.h> 16#include <linux/slab.h>
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index cbda6de0a77c..12ccf880eb88 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -62,6 +62,8 @@
62 * 2 of the License, or (at your option) any later version. 62 * 2 of the License, or (at your option) any later version.
63 */ 63 */
64 64
65#define pr_fmt(fmt) "IPv4: " fmt
66
65#include <linux/module.h> 67#include <linux/module.h>
66#include <asm/uaccess.h> 68#include <asm/uaccess.h>
67#include <asm/system.h> 69#include <asm/system.h>
@@ -1298,7 +1300,7 @@ restart:
1298 } 1300 }
1299 1301
1300 if (net_ratelimit()) 1302 if (net_ratelimit())
1301 pr_warn("ipv4: Neighbour table overflow\n"); 1303 pr_warn("Neighbour table overflow\n");
1302 rt_drop(rt); 1304 rt_drop(rt);
1303 return ERR_PTR(-ENOBUFS); 1305 return ERR_PTR(-ENOBUFS);
1304 } 1306 }
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 2baba1bed810..cfd7edda0a8e 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -245,6 +245,8 @@
245 * TCP_CLOSE socket is finished 245 * TCP_CLOSE socket is finished
246 */ 246 */
247 247
248#define pr_fmt(fmt) "TCP: " fmt
249
248#include <linux/kernel.h> 250#include <linux/kernel.h>
249#include <linux/module.h> 251#include <linux/module.h>
250#include <linux/types.h> 252#include <linux/types.h>
@@ -1675,7 +1677,8 @@ do_prequeue:
1675 1677
1676 if (tp->ucopy.dma_cookie < 0) { 1678 if (tp->ucopy.dma_cookie < 0) {
1677 1679
1678 pr_alert("dma_cookie < 0\n"); 1680 pr_alert("%s: dma_cookie < 0\n",
1681 __func__);
1679 1682
1680 /* Exception. Bailout! */ 1683 /* Exception. Bailout! */
1681 if (!copied) 1684 if (!copied)
@@ -1884,9 +1887,9 @@ bool tcp_check_oom(struct sock *sk, int shift)
1884 out_of_socket_memory = tcp_out_of_memory(sk); 1887 out_of_socket_memory = tcp_out_of_memory(sk);
1885 1888
1886 if (too_many_orphans && net_ratelimit()) 1889 if (too_many_orphans && net_ratelimit())
1887 pr_info("TCP: too many orphaned sockets\n"); 1890 pr_info("too many orphaned sockets\n");
1888 if (out_of_socket_memory && net_ratelimit()) 1891 if (out_of_socket_memory && net_ratelimit())
1889 pr_info("TCP: out of memory -- consider tuning tcp_mem\n"); 1892 pr_info("out of memory -- consider tuning tcp_mem\n");
1890 return too_many_orphans || out_of_socket_memory; 1893 return too_many_orphans || out_of_socket_memory;
1891} 1894}
1892 1895
@@ -3311,7 +3314,7 @@ void __init tcp_init(void)
3311 sysctl_tcp_rmem[1] = 87380; 3314 sysctl_tcp_rmem[1] = 87380;
3312 sysctl_tcp_rmem[2] = max(87380, max_share); 3315 sysctl_tcp_rmem[2] = max(87380, max_share);
3313 3316
3314 pr_info("TCP: Hash tables configured (established %u bind %u)\n", 3317 pr_info("Hash tables configured (established %u bind %u)\n",
3315 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3318 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size);
3316 3319
3317 tcp_register_congestion_control(&tcp_reno); 3320 tcp_register_congestion_control(&tcp_reno);
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 67bab75f441f..272a84593c85 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -6,6 +6,8 @@
6 * Copyright (C) 2005 Stephen Hemminger <shemminger@osdl.org> 6 * Copyright (C) 2005 Stephen Hemminger <shemminger@osdl.org>
7 */ 7 */
8 8
9#define pr_fmt(fmt) "TCP: " fmt
10
9#include <linux/module.h> 11#include <linux/module.h>
10#include <linux/mm.h> 12#include <linux/mm.h>
11#include <linux/types.h> 13#include <linux/types.h>
@@ -41,17 +43,17 @@ int tcp_register_congestion_control(struct tcp_congestion_ops *ca)
41 43
42 /* all algorithms must implement ssthresh and cong_avoid ops */ 44 /* all algorithms must implement ssthresh and cong_avoid ops */
43 if (!ca->ssthresh || !ca->cong_avoid) { 45 if (!ca->ssthresh || !ca->cong_avoid) {
44 pr_err("TCP %s does not implement required ops\n", ca->name); 46 pr_err("%s does not implement required ops\n", ca->name);
45 return -EINVAL; 47 return -EINVAL;
46 } 48 }
47 49
48 spin_lock(&tcp_cong_list_lock); 50 spin_lock(&tcp_cong_list_lock);
49 if (tcp_ca_find(ca->name)) { 51 if (tcp_ca_find(ca->name)) {
50 pr_notice("TCP %s already registered\n", ca->name); 52 pr_notice("%s already registered\n", ca->name);
51 ret = -EEXIST; 53 ret = -EEXIST;
52 } else { 54 } else {
53 list_add_tail_rcu(&ca->list, &tcp_cong_list); 55 list_add_tail_rcu(&ca->list, &tcp_cong_list);
54 pr_info("TCP %s registered\n", ca->name); 56 pr_info("%s registered\n", ca->name);
55 } 57 }
56 spin_unlock(&tcp_cong_list_lock); 58 spin_unlock(&tcp_cong_list_lock);
57 59
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 23ca3663d1e8..68d4057cba00 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -61,6 +61,8 @@
61 * Pasi Sarolahti: F-RTO for dealing with spurious RTOs 61 * Pasi Sarolahti: F-RTO for dealing with spurious RTOs
62 */ 62 */
63 63
64#define pr_fmt(fmt) "TCP: " fmt
65
64#include <linux/mm.h> 66#include <linux/mm.h>
65#include <linux/slab.h> 67#include <linux/slab.h>
66#include <linux/module.h> 68#include <linux/module.h>
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 257dba66eaca..fe9f604ed1e2 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -50,6 +50,7 @@
50 * a single port at the same time. 50 * a single port at the same time.
51 */ 51 */
52 52
53#define pr_fmt(fmt) "TCP: " fmt
53 54
54#include <linux/bottom_half.h> 55#include <linux/bottom_half.h>
55#include <linux/types.h> 56#include <linux/types.h>
@@ -876,8 +877,7 @@ int tcp_syn_flood_action(struct sock *sk,
876 lopt = inet_csk(sk)->icsk_accept_queue.listen_opt; 877 lopt = inet_csk(sk)->icsk_accept_queue.listen_opt;
877 if (!lopt->synflood_warned) { 878 if (!lopt->synflood_warned) {
878 lopt->synflood_warned = 1; 879 lopt->synflood_warned = 1;
879 pr_info("%s: Possible SYN flooding on port %d. %s. " 880 pr_info("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n",
880 " Check SNMP counters.\n",
881 proto, ntohs(tcp_hdr(skb)->dest), msg); 881 proto, ntohs(tcp_hdr(skb)->dest), msg);
882 } 882 }
883 return want_cookie; 883 return want_cookie;
@@ -1399,7 +1399,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1399 * to destinations, already remembered 1399 * to destinations, already remembered
1400 * to the moment of synflood. 1400 * to the moment of synflood.
1401 */ 1401 */
1402 LIMIT_NETDEBUG(KERN_DEBUG "TCP: drop open request from %pI4/%u\n", 1402 LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("drop open request from %pI4/%u\n"),
1403 &saddr, ntohs(tcp_hdr(skb)->source)); 1403 &saddr, ntohs(tcp_hdr(skb)->source));
1404 goto drop_and_release; 1404 goto drop_and_release;
1405 } 1405 }
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 85ee7eb7e38e..a981cdc0a6e9 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -18,6 +18,8 @@
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20 20
21#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22
21#include <linux/kernel.h> 23#include <linux/kernel.h>
22#include <linux/kprobes.h> 24#include <linux/kprobes.h>
23#include <linux/socket.h> 25#include <linux/socket.h>
@@ -239,7 +241,7 @@ static __init int tcpprobe_init(void)
239 if (ret) 241 if (ret)
240 goto err1; 242 goto err1;
241 243
242 pr_info("TCP probe registered (port=%d) bufsize=%u\n", port, bufsize); 244 pr_info("probe registered (port=%d) bufsize=%u\n", port, bufsize);
243 return 0; 245 return 0;
244 err1: 246 err1:
245 proc_net_remove(&init_net, procname); 247 proc_net_remove(&init_net, procname);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index cd2e0723266d..34d4a02c2f16 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -333,16 +333,18 @@ void tcp_retransmit_timer(struct sock *sk)
333 */ 333 */
334 struct inet_sock *inet = inet_sk(sk); 334 struct inet_sock *inet = inet_sk(sk);
335 if (sk->sk_family == AF_INET) { 335 if (sk->sk_family == AF_INET) {
336 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI4:%u/%u unexpectedly shrunk window %u:%u (repaired)\n", 336 LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("Peer %pI4:%u/%u unexpectedly shrunk window %u:%u (repaired)\n"),
337 &inet->inet_daddr, ntohs(inet->inet_dport), 337 &inet->inet_daddr,
338 inet->inet_num, tp->snd_una, tp->snd_nxt); 338 ntohs(inet->inet_dport), inet->inet_num,
339 tp->snd_una, tp->snd_nxt);
339 } 340 }
340#if IS_ENABLED(CONFIG_IPV6) 341#if IS_ENABLED(CONFIG_IPV6)
341 else if (sk->sk_family == AF_INET6) { 342 else if (sk->sk_family == AF_INET6) {
342 struct ipv6_pinfo *np = inet6_sk(sk); 343 struct ipv6_pinfo *np = inet6_sk(sk);
343 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n", 344 LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("Peer %pI6:%u/%u unexpectedly shrunk window %u:%u (repaired)\n"),
344 &np->daddr, ntohs(inet->inet_dport), 345 &np->daddr,
345 inet->inet_num, tp->snd_una, tp->snd_nxt); 346 ntohs(inet->inet_dport), inet->inet_num,
347 tp->snd_una, tp->snd_nxt);
346 } 348 }
347#endif 349#endif
348 if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) { 350 if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 7c41ab84e72e..d6f5feeb3eaf 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -77,6 +77,8 @@
77 * 2 of the License, or (at your option) any later version. 77 * 2 of the License, or (at your option) any later version.
78 */ 78 */
79 79
80#define pr_fmt(fmt) "UDP: " fmt
81
80#include <asm/system.h> 82#include <asm/system.h>
81#include <asm/uaccess.h> 83#include <asm/uaccess.h>
82#include <asm/ioctls.h> 84#include <asm/ioctls.h>
@@ -975,7 +977,7 @@ back_from_confirm:
975 /* ... which is an evident application bug. --ANK */ 977 /* ... which is an evident application bug. --ANK */
976 release_sock(sk); 978 release_sock(sk);
977 979
978 LIMIT_NETDEBUG(KERN_DEBUG "udp cork app bug 2\n"); 980 LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("cork app bug 2\n"));
979 err = -EINVAL; 981 err = -EINVAL;
980 goto out; 982 goto out;
981 } 983 }
@@ -1054,7 +1056,7 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset,
1054 if (unlikely(!up->pending)) { 1056 if (unlikely(!up->pending)) {
1055 release_sock(sk); 1057 release_sock(sk);
1056 1058
1057 LIMIT_NETDEBUG(KERN_DEBUG "udp cork app bug 3\n"); 1059 LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("udp cork app bug 3\n"));
1058 return -EINVAL; 1060 return -EINVAL;
1059 } 1061 }
1060 1062
@@ -1447,9 +1449,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
1447 * provided by the application." 1449 * provided by the application."
1448 */ 1450 */
1449 if (up->pcrlen == 0) { /* full coverage was set */ 1451 if (up->pcrlen == 0) { /* full coverage was set */
1450 LIMIT_NETDEBUG(KERN_WARNING "UDPLITE: partial coverage " 1452 LIMIT_NETDEBUG(KERN_WARNING "UDPLite: partial coverage %d while full coverage %d requested\n",
1451 "%d while full coverage %d requested\n", 1453 UDP_SKB_CB(skb)->cscov, skb->len);
1452 UDP_SKB_CB(skb)->cscov, skb->len);
1453 goto drop; 1454 goto drop;
1454 } 1455 }
1455 /* The next case involves violating the min. coverage requested 1456 /* The next case involves violating the min. coverage requested
@@ -1459,9 +1460,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
1459 * Therefore the above ...()->partial_cov statement is essential. 1460 * Therefore the above ...()->partial_cov statement is essential.
1460 */ 1461 */
1461 if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { 1462 if (UDP_SKB_CB(skb)->cscov < up->pcrlen) {
1462 LIMIT_NETDEBUG(KERN_WARNING 1463 LIMIT_NETDEBUG(KERN_WARNING "UDPLite: coverage %d too small, need min %d\n",
1463 "UDPLITE: coverage %d too small, need min %d\n", 1464 UDP_SKB_CB(skb)->cscov, up->pcrlen);
1464 UDP_SKB_CB(skb)->cscov, up->pcrlen);
1465 goto drop; 1465 goto drop;
1466 } 1466 }
1467 } 1467 }
@@ -1689,13 +1689,10 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1689 1689
1690short_packet: 1690short_packet:
1691 LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n", 1691 LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n",
1692 proto == IPPROTO_UDPLITE ? "-Lite" : "", 1692 proto == IPPROTO_UDPLITE ? "Lite" : "",
1693 &saddr, 1693 &saddr, ntohs(uh->source),
1694 ntohs(uh->source), 1694 ulen, skb->len,
1695 ulen, 1695 &daddr, ntohs(uh->dest));
1696 skb->len,
1697 &daddr,
1698 ntohs(uh->dest));
1699 goto drop; 1696 goto drop;
1700 1697
1701csum_error: 1698csum_error:
@@ -1704,11 +1701,8 @@ csum_error:
1704 * the network is concerned, anyway) as per 4.1.3.4 (MUST). 1701 * the network is concerned, anyway) as per 4.1.3.4 (MUST).
1705 */ 1702 */
1706 LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n", 1703 LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n",
1707 proto == IPPROTO_UDPLITE ? "-Lite" : "", 1704 proto == IPPROTO_UDPLITE ? "Lite" : "",
1708 &saddr, 1705 &saddr, ntohs(uh->source), &daddr, ntohs(uh->dest),
1709 ntohs(uh->source),
1710 &daddr,
1711 ntohs(uh->dest),
1712 ulen); 1706 ulen);
1713drop: 1707drop:
1714 UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); 1708 UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE);
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 280bfb12adcc..2c46acd4cc36 100644
--- a/net/ipv4/udplite.c
+++ b/net/ipv4/udplite.c
@@ -10,6 +10,9 @@
10 * as published by the Free Software Foundation; either version 10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version. 11 * 2 of the License, or (at your option) any later version.
12 */ 12 */
13
14#define pr_fmt(fmt) "UDPLite: " fmt
15
13#include <linux/export.h> 16#include <linux/export.h>
14#include "udp_impl.h" 17#include "udp_impl.h"
15 18
diff --git a/net/ipv4/xfrm4_tunnel.c b/net/ipv4/xfrm4_tunnel.c
index 5b48f49df0ba..05a5df2febc9 100644
--- a/net/ipv4/xfrm4_tunnel.c
+++ b/net/ipv4/xfrm4_tunnel.c
@@ -3,6 +3,8 @@
3 * Copyright (C) 2003 David S. Miller (davem@redhat.com) 3 * Copyright (C) 2003 David S. Miller (davem@redhat.com)
4 */ 4 */
5 5
6#define pr_fmt(fmt) "IPsec: " fmt
7
6#include <linux/skbuff.h> 8#include <linux/skbuff.h>
7#include <linux/module.h> 9#include <linux/module.h>
8#include <linux/mutex.h> 10#include <linux/mutex.h>