Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64ce2073 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NET]: Make NETDEBUG pure printk wrappers

parent 64cf1e5d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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

/*
+1 −1
Original line number Diff line number Diff line
@@ -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);
+4 −4
Original line number Diff line number Diff line
@@ -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;
	}

@@ -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;
	}

@@ -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;
	}

@@ -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;
	}

+6 −6
Original line number Diff line number Diff line
@@ -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);
}

@@ -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",
			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));
				 aalg_desc->uinfo.auth.icv_fullbits/8);
			goto error;
		}

+5 −7
Original line number Diff line number Diff line
@@ -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));
@@ -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;
@@ -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;
Loading