diff options
author | Joe Perches <joe@perches.com> | 2014-11-11 13:59:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-11 14:10:31 -0500 |
commit | ba7a46f16dd29f93303daeb1fee8af316c5a07f4 (patch) | |
tree | 72568f33fadf0b75d02f6e30bca1404a5aae2530 /net/ipv4/udp.c | |
parent | 5b61c4db49e2530ed10631321d4c73f49d560a93 (diff) |
net: Convert LIMIT_NETDEBUG to net_dbg_ratelimited
Use the more common dynamic_debug capable net_dbg_ratelimited
and remove the LIMIT_NETDEBUG macro.
All messages are still ratelimited.
Some KERN_<LEVEL> uses are changed to KERN_DEBUG.
This may have some negative impact on messages that were
emitted at KERN_INFO that are not not enabled at all unless
DEBUG is defined or dynamic_debug is enabled. Even so,
these messages are now _not_ emitted by default.
This also eliminates the use of the net_msg_warn sysctl
"/proc/sys/net/core/warnings". For backward compatibility,
the sysctl is not removed, but it has no function. The extern
declaration of net_msg_warn is removed from sock.h and made
static in net/core/sysctl_net_core.c
Miscellanea:
o Update the sysctl documentation
o Remove the embedded uses of pr_fmt
o Coalesce format fragments
o Realign arguments
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index d13751685f44..1b6e9d5fadef 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1051,7 +1051,7 @@ back_from_confirm: | |||
1051 | /* ... which is an evident application bug. --ANK */ | 1051 | /* ... which is an evident application bug. --ANK */ |
1052 | release_sock(sk); | 1052 | release_sock(sk); |
1053 | 1053 | ||
1054 | LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("cork app bug 2\n")); | 1054 | net_dbg_ratelimited("cork app bug 2\n"); |
1055 | err = -EINVAL; | 1055 | err = -EINVAL; |
1056 | goto out; | 1056 | goto out; |
1057 | } | 1057 | } |
@@ -1133,7 +1133,7 @@ int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
1133 | if (unlikely(!up->pending)) { | 1133 | if (unlikely(!up->pending)) { |
1134 | release_sock(sk); | 1134 | release_sock(sk); |
1135 | 1135 | ||
1136 | LIMIT_NETDEBUG(KERN_DEBUG pr_fmt("udp cork app bug 3\n")); | 1136 | net_dbg_ratelimited("udp cork app bug 3\n"); |
1137 | return -EINVAL; | 1137 | return -EINVAL; |
1138 | } | 1138 | } |
1139 | 1139 | ||
@@ -1547,8 +1547,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1547 | * provided by the application." | 1547 | * provided by the application." |
1548 | */ | 1548 | */ |
1549 | if (up->pcrlen == 0) { /* full coverage was set */ | 1549 | if (up->pcrlen == 0) { /* full coverage was set */ |
1550 | LIMIT_NETDEBUG(KERN_WARNING "UDPLite: partial coverage %d while full coverage %d requested\n", | 1550 | net_dbg_ratelimited("UDPLite: partial coverage %d while full coverage %d requested\n", |
1551 | UDP_SKB_CB(skb)->cscov, skb->len); | 1551 | UDP_SKB_CB(skb)->cscov, skb->len); |
1552 | goto drop; | 1552 | goto drop; |
1553 | } | 1553 | } |
1554 | /* The next case involves violating the min. coverage requested | 1554 | /* The next case involves violating the min. coverage requested |
@@ -1558,8 +1558,8 @@ int udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
1558 | * Therefore the above ...()->partial_cov statement is essential. | 1558 | * Therefore the above ...()->partial_cov statement is essential. |
1559 | */ | 1559 | */ |
1560 | if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { | 1560 | if (UDP_SKB_CB(skb)->cscov < up->pcrlen) { |
1561 | LIMIT_NETDEBUG(KERN_WARNING "UDPLite: coverage %d too small, need min %d\n", | 1561 | net_dbg_ratelimited("UDPLite: coverage %d too small, need min %d\n", |
1562 | UDP_SKB_CB(skb)->cscov, up->pcrlen); | 1562 | UDP_SKB_CB(skb)->cscov, up->pcrlen); |
1563 | goto drop; | 1563 | goto drop; |
1564 | } | 1564 | } |
1565 | } | 1565 | } |
@@ -1828,11 +1828,11 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
1828 | return 0; | 1828 | return 0; |
1829 | 1829 | ||
1830 | short_packet: | 1830 | short_packet: |
1831 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n", | 1831 | net_dbg_ratelimited("UDP%s: short packet: From %pI4:%u %d/%d to %pI4:%u\n", |
1832 | proto == IPPROTO_UDPLITE ? "Lite" : "", | 1832 | proto == IPPROTO_UDPLITE ? "Lite" : "", |
1833 | &saddr, ntohs(uh->source), | 1833 | &saddr, ntohs(uh->source), |
1834 | ulen, skb->len, | 1834 | ulen, skb->len, |
1835 | &daddr, ntohs(uh->dest)); | 1835 | &daddr, ntohs(uh->dest)); |
1836 | goto drop; | 1836 | goto drop; |
1837 | 1837 | ||
1838 | csum_error: | 1838 | csum_error: |
@@ -1840,10 +1840,10 @@ csum_error: | |||
1840 | * RFC1122: OK. Discards the bad packet silently (as far as | 1840 | * RFC1122: OK. Discards the bad packet silently (as far as |
1841 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). | 1841 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). |
1842 | */ | 1842 | */ |
1843 | LIMIT_NETDEBUG(KERN_DEBUG "UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n", | 1843 | net_dbg_ratelimited("UDP%s: bad checksum. From %pI4:%u to %pI4:%u ulen %d\n", |
1844 | proto == IPPROTO_UDPLITE ? "Lite" : "", | 1844 | proto == IPPROTO_UDPLITE ? "Lite" : "", |
1845 | &saddr, ntohs(uh->source), &daddr, ntohs(uh->dest), | 1845 | &saddr, ntohs(uh->source), &daddr, ntohs(uh->dest), |
1846 | ulen); | 1846 | ulen); |
1847 | UDP_INC_STATS_BH(net, UDP_MIB_CSUMERRORS, proto == IPPROTO_UDPLITE); | 1847 | UDP_INC_STATS_BH(net, UDP_MIB_CSUMERRORS, proto == IPPROTO_UDPLITE); |
1848 | drop: | 1848 | drop: |
1849 | UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); | 1849 | UDP_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); |