diff options
author | Heikki Orsila <heikki.orsila@iki.fi> | 2005-08-08 17:26:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-08-08 17:26:52 -0400 |
commit | ca9334523c853e407da7b3a0bd02f54d0fa59414 (patch) | |
tree | 3c4f8050d9bc0e062038c1f7e22722e0e6447bfc /net/ipv4/udp.c | |
parent | 4d479e40e1748a877a24015fc6727b27b77110cd (diff) |
[IPV4]: Debug cleanup
Here's a small patch to cleanup NETDEBUG() use in net/ipv4/ for Linux
kernel 2.6.13-rc5. Also weird use of indentation is changed in some
places.
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 7c24e64b443f..dc4d07357e3a 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -628,7 +628,7 @@ back_from_confirm: | |||
628 | /* ... which is an evident application bug. --ANK */ | 628 | /* ... which is an evident application bug. --ANK */ |
629 | release_sock(sk); | 629 | release_sock(sk); |
630 | 630 | ||
631 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 2\n")); | 631 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 2\n")); |
632 | err = -EINVAL; | 632 | err = -EINVAL; |
633 | goto out; | 633 | goto out; |
634 | } | 634 | } |
@@ -693,7 +693,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
693 | if (unlikely(!up->pending)) { | 693 | if (unlikely(!up->pending)) { |
694 | release_sock(sk); | 694 | release_sock(sk); |
695 | 695 | ||
696 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 3\n")); | 696 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 3\n")); |
697 | return -EINVAL; | 697 | return -EINVAL; |
698 | } | 698 | } |
699 | 699 | ||
@@ -1102,7 +1102,7 @@ static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, | |||
1102 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1102 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1103 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) | 1103 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) |
1104 | return 0; | 1104 | return 0; |
1105 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp v4 hw csum failure.\n")); | 1105 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp v4 hw csum failure.\n")); |
1106 | skb->ip_summed = CHECKSUM_NONE; | 1106 | skb->ip_summed = CHECKSUM_NONE; |
1107 | } | 1107 | } |
1108 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) | 1108 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) |
@@ -1181,14 +1181,13 @@ int udp_rcv(struct sk_buff *skb) | |||
1181 | return(0); | 1181 | return(0); |
1182 | 1182 | ||
1183 | short_packet: | 1183 | short_packet: |
1184 | NETDEBUG(if (net_ratelimit()) | 1184 | LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n", |
1185 | printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n", | 1185 | NIPQUAD(saddr), |
1186 | NIPQUAD(saddr), | 1186 | ntohs(uh->source), |
1187 | ntohs(uh->source), | 1187 | ulen, |
1188 | ulen, | 1188 | len, |
1189 | len, | 1189 | NIPQUAD(daddr), |
1190 | NIPQUAD(daddr), | 1190 | ntohs(uh->dest))); |
1191 | ntohs(uh->dest))); | ||
1192 | no_header: | 1191 | no_header: |
1193 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 1192 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
1194 | kfree_skb(skb); | 1193 | kfree_skb(skb); |
@@ -1199,13 +1198,12 @@ csum_error: | |||
1199 | * RFC1122: OK. Discards the bad packet silently (as far as | 1198 | * RFC1122: OK. Discards the bad packet silently (as far as |
1200 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). | 1199 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). |
1201 | */ | 1200 | */ |
1202 | NETDEBUG(if (net_ratelimit()) | 1201 | LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n", |
1203 | printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n", | 1202 | NIPQUAD(saddr), |
1204 | NIPQUAD(saddr), | 1203 | ntohs(uh->source), |
1205 | ntohs(uh->source), | 1204 | NIPQUAD(daddr), |
1206 | NIPQUAD(daddr), | 1205 | ntohs(uh->dest), |
1207 | ntohs(uh->dest), | 1206 | ulen)); |
1208 | ulen)); | ||
1209 | drop: | 1207 | drop: |
1210 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 1208 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
1211 | kfree_skb(skb); | 1209 | kfree_skb(skb); |