Commit ca933452 authored by Heikki Orsila's avatar Heikki Orsila Committed by David S. Miller

[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: default avatarHeikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d479e40
...@@ -936,8 +936,7 @@ int icmp_rcv(struct sk_buff *skb) ...@@ -936,8 +936,7 @@ int icmp_rcv(struct sk_buff *skb)
case CHECKSUM_HW: case CHECKSUM_HW:
if (!(u16)csum_fold(skb->csum)) if (!(u16)csum_fold(skb->csum))
break; break;
NETDEBUG(if (net_ratelimit()) LIMIT_NETDEBUG(printk(KERN_DEBUG "icmp v4 hw csum failure\n"));
printk(KERN_DEBUG "icmp v4 hw csum failure\n"));
case CHECKSUM_NONE: case CHECKSUM_NONE:
if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0)))
goto error; goto error;
......
...@@ -377,7 +377,7 @@ static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) ...@@ -377,7 +377,7 @@ static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user)
return ip_frag_intern(hash, qp); return ip_frag_intern(hash, qp);
out_nomem: out_nomem:
NETDEBUG(if (net_ratelimit()) printk(KERN_ERR "ip_frag_create: no memory left !\n")); LIMIT_NETDEBUG(printk(KERN_ERR "ip_frag_create: no memory left !\n"));
return NULL; return NULL;
} }
...@@ -625,10 +625,8 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev) ...@@ -625,10 +625,8 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
return head; return head;
out_nomem: out_nomem:
NETDEBUG(if (net_ratelimit()) LIMIT_NETDEBUG(printk(KERN_ERR "IP: queue_glue: no memory for gluing "
printk(KERN_ERR "queue %p\n", qp));
"IP: queue_glue: no memory for gluing queue %p\n",
qp));
goto out_fail; goto out_fail;
out_oversize: out_oversize:
if (net_ratelimit()) if (net_ratelimit())
......
...@@ -1494,10 +1494,9 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) ...@@ -1494,10 +1494,9 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
* to destinations, already remembered * to destinations, already remembered
* to the moment of synflood. * to the moment of synflood.
*/ */
NETDEBUG(if (net_ratelimit()) \ LIMIT_NETDEBUG(printk(KERN_DEBUG "TCP: drop open "
printk(KERN_DEBUG "TCP: drop open "
"request from %u.%u." "request from %u.%u."
"%u.%u/%u\n", \ "%u.%u/%u\n",
NIPQUAD(saddr), NIPQUAD(saddr),
ntohs(skb->h.th->source))); ntohs(skb->h.th->source)));
dst_release(dst); dst_release(dst);
...@@ -1627,8 +1626,7 @@ static int tcp_v4_checksum_init(struct sk_buff *skb) ...@@ -1627,8 +1626,7 @@ static int tcp_v4_checksum_init(struct sk_buff *skb)
skb->nh.iph->daddr, skb->csum)) skb->nh.iph->daddr, skb->csum))
return 0; return 0;
NETDEBUG(if (net_ratelimit()) LIMIT_NETDEBUG(printk(KERN_DEBUG "hw tcp v4 csum failed\n"));
printk(KERN_DEBUG "hw tcp v4 csum failed\n"));
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
} }
if (skb->len <= 76) { if (skb->len <= 76) {
......
...@@ -628,7 +628,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -628,7 +628,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
/* ... which is an evident application bug. --ANK */ /* ... which is an evident application bug. --ANK */
release_sock(sk); release_sock(sk);
NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 2\n")); LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 2\n"));
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
...@@ -693,7 +693,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset, ...@@ -693,7 +693,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset,
if (unlikely(!up->pending)) { if (unlikely(!up->pending)) {
release_sock(sk); release_sock(sk);
NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 3\n")); LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 3\n"));
return -EINVAL; return -EINVAL;
} }
...@@ -1102,7 +1102,7 @@ static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, ...@@ -1102,7 +1102,7 @@ static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh,
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) if (!udp_check(uh, ulen, saddr, daddr, skb->csum))
return 0; return 0;
NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp v4 hw csum failure.\n")); LIMIT_NETDEBUG(printk(KERN_DEBUG "udp v4 hw csum failure.\n"));
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
} }
if (skb->ip_summed != CHECKSUM_UNNECESSARY) if (skb->ip_summed != CHECKSUM_UNNECESSARY)
...@@ -1181,8 +1181,7 @@ int udp_rcv(struct sk_buff *skb) ...@@ -1181,8 +1181,7 @@ int udp_rcv(struct sk_buff *skb)
return(0); return(0);
short_packet: short_packet:
NETDEBUG(if (net_ratelimit()) LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n",
printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n",
NIPQUAD(saddr), NIPQUAD(saddr),
ntohs(uh->source), ntohs(uh->source),
ulen, ulen,
...@@ -1199,8 +1198,7 @@ int udp_rcv(struct sk_buff *skb) ...@@ -1199,8 +1198,7 @@ int udp_rcv(struct sk_buff *skb)
* RFC1122: OK. Discards the bad packet silently (as far as * RFC1122: OK. Discards the bad packet silently (as far as
* the network is concerned, anyway) as per 4.1.3.4 (MUST). * the network is concerned, anyway) as per 4.1.3.4 (MUST).
*/ */
NETDEBUG(if (net_ratelimit()) LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n",
printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n",
NIPQUAD(saddr), NIPQUAD(saddr),
ntohs(uh->source), ntohs(uh->source),
NIPQUAD(daddr), NIPQUAD(daddr),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment