Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6326
b: refs/heads/master
c: 64ce207
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Aug 29, 2005
1 parent dd71f6c commit d7b3f06
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 90 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64cf1e5d8b5f88d56509260e08fa0d8314277350
refs/heads/master: 64ce207306debd7157f47282be94770407bec01c
8 changes: 4 additions & 4 deletions trunk/include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -1316,11 +1316,11 @@ extern int sock_get_timestamp(struct sock *, struct timeval __user *);
*/

#if 0
#define NETDEBUG(x) do { } while (0)
#define LIMIT_NETDEBUG(x) do {} while(0)
#define NETDEBUG(fmt, args...) do { } while (0)
#define LIMIT_NETDEBUG(fmt, args...) do { } while(0)
#else
#define NETDEBUG(x) do { x; } while (0)
#define LIMIT_NETDEBUG(x) do { if (net_ratelimit()) { x; } } while(0)
#define NETDEBUG(fmt, args...) printk(fmt,##args)
#define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0)
#endif

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/dccp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
if (dccp_ackpkts_add(dp->dccps_hc_rx_ackpkts,
DCCP_SKB_CB(skb)->dccpd_seq,
DCCP_ACKPKTS_STATE_RECEIVED)) {
LIMIT_NETDEBUG(pr_info("DCCP: acknowledgeable packets buffer full!\n"));
LIMIT_NETDEBUG(KERN_INFO "DCCP: acknowledgeable packets buffer full!\n");
ap->dccpap_ack_seqno = DCCP_MAX_SEQNO + 1;
inet_csk_schedule_ack(sk);
inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK, TCP_DELACK_MIN, TCP_RTO_MAX);
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void dccp_insert_option(struct sock *sk, struct sk_buff *skb,
unsigned char *to;

if (DCCP_SKB_CB(skb)->dccpd_opt_len + len + 2 > DCCP_MAX_OPT_LEN) {
LIMIT_NETDEBUG(pr_info("DCCP: packet too small to insert %d option!\n", option));
LIMIT_NETDEBUG(KERN_INFO "DCCP: packet too small to insert %d option!\n", option);
return;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ void dccp_insert_option_elapsed_time(struct sock *sk,
return;

if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN) {
LIMIT_NETDEBUG(pr_info("DCCP: packet too small to insert elapsed time!\n"));
LIMIT_NETDEBUG(KERN_INFO "DCCP: packet too small to insert elapsed time!\n");
return;
}

Expand Down Expand Up @@ -335,7 +335,7 @@ static void dccp_insert_option_ack_vector(struct sock *sk, struct sk_buff *skb)
dccp_insert_option_elapsed_time(sk, skb, elapsed_time);

if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN) {
LIMIT_NETDEBUG(pr_info("DCCP: packet too small to insert ACK Vector!\n"));
LIMIT_NETDEBUG(KERN_INFO "DCCP: packet too small to insert ACK Vector!\n");
return;
}

Expand Down Expand Up @@ -412,7 +412,7 @@ static void dccp_insert_option_timestamp_echo(struct sock *sk, struct sk_buff *s
unsigned char *to;

if (DCCP_SKB_CB(skb)->dccpd_opt_len + len > DCCP_MAX_OPT_LEN) {
LIMIT_NETDEBUG(pr_info("DCCP: packet too small to insert timestamp echo!\n"));
LIMIT_NETDEBUG(KERN_INFO "DCCP: packet too small to insert timestamp echo!\n");
return;
}

Expand Down
12 changes: 6 additions & 6 deletions trunk/net/ipv4/esp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ static void esp4_err(struct sk_buff *skb, u32 info)
x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET);
if (!x)
return;
NETDEBUG(printk(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
ntohl(esph->spi), ntohl(iph->daddr)));
NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
ntohl(esph->spi), ntohl(iph->daddr));
xfrm_state_put(x);
}

Expand Down Expand Up @@ -395,10 +395,10 @@ static int esp_init_state(struct xfrm_state *x)

if (aalg_desc->uinfo.auth.icv_fullbits/8 !=
crypto_tfm_alg_digestsize(esp->auth.tfm)) {
NETDEBUG(printk(KERN_INFO "ESP: %s digestsize %u != %hu\n",
x->aalg->alg_name,
crypto_tfm_alg_digestsize(esp->auth.tfm),
aalg_desc->uinfo.auth.icv_fullbits/8));
NETDEBUG(KERN_INFO "ESP: %s digestsize %u != %hu\n",
x->aalg->alg_name,
crypto_tfm_alg_digestsize(esp->auth.tfm),
aalg_desc->uinfo.auth.icv_fullbits/8);
goto error;
}

Expand Down
12 changes: 5 additions & 7 deletions trunk/net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,10 @@ static void icmp_unreach(struct sk_buff *skb)
break;
case ICMP_FRAG_NEEDED:
if (ipv4_config.no_pmtu_disc) {
LIMIT_NETDEBUG(
printk(KERN_INFO "ICMP: %u.%u.%u.%u: "
LIMIT_NETDEBUG(KERN_INFO "ICMP: %u.%u.%u.%u: "
"fragmentation needed "
"and DF set.\n",
NIPQUAD(iph->daddr)));
NIPQUAD(iph->daddr));
} else {
info = ip_rt_frag_needed(iph,
ntohs(icmph->un.frag.mtu));
Expand All @@ -640,10 +639,9 @@ static void icmp_unreach(struct sk_buff *skb)
}
break;
case ICMP_SR_FAILED:
LIMIT_NETDEBUG(
printk(KERN_INFO "ICMP: %u.%u.%u.%u: Source "
LIMIT_NETDEBUG(KERN_INFO "ICMP: %u.%u.%u.%u: Source "
"Route Failed.\n",
NIPQUAD(iph->daddr)));
NIPQUAD(iph->daddr));
break;
default:
break;
Expand Down Expand Up @@ -936,7 +934,7 @@ int icmp_rcv(struct sk_buff *skb)
case CHECKSUM_HW:
if (!(u16)csum_fold(skb->csum))
break;
LIMIT_NETDEBUG(printk(KERN_DEBUG "icmp v4 hw csum failure\n"));
LIMIT_NETDEBUG(KERN_DEBUG "icmp v4 hw csum failure\n");
case CHECKSUM_NONE:
if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0)))
goto error;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ int igmp_rcv(struct sk_buff *skb)
case IGMP_MTRACE_RESP:
break;
default:
NETDEBUG(printk(KERN_DEBUG "New IGMP type=%d, why we do not know about it?\n", ih->type));
NETDEBUG(KERN_DEBUG "New IGMP type=%d, why we do not know about it?\n", ih->type);
}
in_dev_put(in_dev);
kfree_skb(skb);
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/ipv4/ip_fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user)
return ip_frag_intern(hash, qp);

out_nomem:
LIMIT_NETDEBUG(printk(KERN_ERR "ip_frag_create: no memory left !\n"));
LIMIT_NETDEBUG(KERN_ERR "ip_frag_create: no memory left !\n");
return NULL;
}

Expand Down Expand Up @@ -625,8 +625,8 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
return head;

out_nomem:
LIMIT_NETDEBUG(printk(KERN_ERR "IP: queue_glue: no memory for gluing "
"queue %p\n", qp));
LIMIT_NETDEBUG(KERN_ERR "IP: queue_glue: no memory for gluing "
"queue %p\n", qp);
goto out_fail;
out_oversize:
if (net_ratelimit())
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
*/

if ((skb2 = alloc_skb(len+hlen+ll_rs, GFP_ATOMIC)) == NULL) {
NETDEBUG(printk(KERN_INFO "IP: frag: no memory for new fragment!\n"));
NETDEBUG(KERN_INFO "IP: frag: no memory for new fragment!\n");
err = -ENOMEM;
goto fail;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/ipcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
spi, IPPROTO_COMP, AF_INET);
if (!x)
return;
NETDEBUG(printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%u.%u.%u.%u\n",
spi, NIPQUAD(iph->daddr)));
NETDEBUG(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%u.%u.%u.%u\n",
spi, NIPQUAD(iph->daddr));
xfrm_state_put(x);
}

Expand Down
11 changes: 5 additions & 6 deletions trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,11 +990,10 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
* to destinations, already remembered
* to the moment of synflood.
*/
LIMIT_NETDEBUG(printk(KERN_DEBUG "TCP: drop open "
"request from %u.%u."
"%u.%u/%u\n",
NIPQUAD(saddr),
ntohs(skb->h.th->source)));
LIMIT_NETDEBUG(KERN_DEBUG "TCP: drop open "
"request from %u.%u.%u.%u/%u\n",
NIPQUAD(saddr),
ntohs(skb->h.th->source));
dst_release(dst);
goto drop_and_free;
}
Expand Down Expand Up @@ -1118,7 +1117,7 @@ static int tcp_v4_checksum_init(struct sk_buff *skb)
skb->nh.iph->daddr, skb->csum))
return 0;

LIMIT_NETDEBUG(printk(KERN_DEBUG "hw tcp v4 csum failed\n"));
LIMIT_NETDEBUG(KERN_DEBUG "hw tcp v4 csum failed\n");
skb->ip_summed = CHECKSUM_NONE;
}
if (skb->len <= 76) {
Expand Down
32 changes: 16 additions & 16 deletions trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
/* ... which is an evident application bug. --ANK */
release_sock(sk);

LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 2\n"));
LIMIT_NETDEBUG(KERN_DEBUG "udp cork app bug 2\n");
err = -EINVAL;
goto out;
}
Expand Down Expand Up @@ -694,7 +694,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset,
if (unlikely(!up->pending)) {
release_sock(sk);

LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 3\n"));
LIMIT_NETDEBUG(KERN_DEBUG "udp cork app bug 3\n");
return -EINVAL;
}

Expand Down Expand Up @@ -1103,7 +1103,7 @@ static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh,
skb->ip_summed = CHECKSUM_UNNECESSARY;
if (!udp_check(uh, ulen, saddr, daddr, skb->csum))
return 0;
LIMIT_NETDEBUG(printk(KERN_DEBUG "udp v4 hw csum failure.\n"));
LIMIT_NETDEBUG(KERN_DEBUG "udp v4 hw csum failure.\n");
skb->ip_summed = CHECKSUM_NONE;
}
if (skb->ip_summed != CHECKSUM_UNNECESSARY)
Expand Down Expand Up @@ -1182,13 +1182,13 @@ int udp_rcv(struct sk_buff *skb)
return(0);

short_packet:
LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n",
NIPQUAD(saddr),
ntohs(uh->source),
ulen,
len,
NIPQUAD(daddr),
ntohs(uh->dest)));
LIMIT_NETDEBUG(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n",
NIPQUAD(saddr),
ntohs(uh->source),
ulen,
len,
NIPQUAD(daddr),
ntohs(uh->dest));
no_header:
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
Expand All @@ -1199,12 +1199,12 @@ int udp_rcv(struct sk_buff *skb)
* RFC1122: OK. Discards the bad packet silently (as far as
* the network is concerned, anyway) as per 4.1.3.4 (MUST).
*/
LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n",
NIPQUAD(saddr),
ntohs(uh->source),
NIPQUAD(daddr),
ntohs(uh->dest),
ulen));
LIMIT_NETDEBUG(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n",
NIPQUAD(saddr),
ntohs(uh->source),
NIPQUAD(daddr),
ntohs(uh->dest),
ulen);
drop:
UDP_INC_STATS_BH(UDP_MIB_INERRORS);
kfree_skb(skb);
Expand Down
13 changes: 6 additions & 7 deletions trunk/net/ipv6/ah6.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ static int ipv6_clear_mutable_options(struct ipv6hdr *iph, int len)
case NEXTHDR_HOP:
case NEXTHDR_DEST:
if (!zero_out_mutable_opts(exthdr.opth)) {
LIMIT_NETDEBUG(printk(
LIMIT_NETDEBUG(
KERN_WARNING "overrun %sopts\n",
nexthdr == NEXTHDR_HOP ?
"hop" : "dest"));
"hop" : "dest");
return -EINVAL;
}
break;
Expand Down Expand Up @@ -293,8 +293,7 @@ static int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struc
skb_push(skb, skb->data - skb->nh.raw);
ahp->icv(ahp, skb, ah->auth_data);
if (memcmp(ah->auth_data, auth_data, ahp->icv_trunc_len)) {
LIMIT_NETDEBUG(
printk(KERN_WARNING "ipsec ah authentication error\n"));
LIMIT_NETDEBUG(KERN_WARNING "ipsec ah authentication error\n");
x->stats.integrity_failed++;
goto free_out;
}
Expand Down Expand Up @@ -332,9 +331,9 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x)
return;

NETDEBUG(printk(KERN_DEBUG "pmtu discovery on SA AH/%08x/"
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
ntohl(ah->spi), NIP6(iph->daddr)));
NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/"
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
ntohl(ah->spi), NIP6(iph->daddr));

xfrm_state_put(x);
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ int datagram_send_ctl(struct msghdr *msg, struct flowi *fl,
break;

default:
LIMIT_NETDEBUG(
printk(KERN_DEBUG "invalid cmsg type: %d\n", cmsg->cmsg_type));
LIMIT_NETDEBUG(KERN_DEBUG "invalid cmsg type: %d\n",
cmsg->cmsg_type);
err = -EINVAL;
break;
};
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv6/esp6.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ static int esp6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, stru

padlen = nexthdr[0];
if (padlen+2 >= elen) {
LIMIT_NETDEBUG(
printk(KERN_WARNING "ipsec esp packet is garbage padlen=%d, elen=%d\n", padlen+2, elen));
LIMIT_NETDEBUG(KERN_WARNING "ipsec esp packet is garbage padlen=%d, elen=%d\n", padlen+2, elen);
ret = -EINVAL;
goto out;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ static int ipv6_hop_ra(struct sk_buff *skb, int optoff)
IP6CB(skb)->ra = optoff;
return 1;
}
LIMIT_NETDEBUG(
printk(KERN_DEBUG "ipv6_hop_ra: wrong RA length %d\n", skb->nh.raw[optoff+1]));
LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_ra: wrong RA length %d\n",
skb->nh.raw[optoff+1]);
kfree_skb(skb);
return 0;
}
Expand All @@ -437,8 +437,8 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
u32 pkt_len;

if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) {
LIMIT_NETDEBUG(
printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]));
LIMIT_NETDEBUG(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n",
skb->nh.raw[optoff+1]);
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
goto drop;
}
Expand Down
Loading

0 comments on commit d7b3f06

Please sign in to comment.