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

Commit c59eab46 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

[DCCP]: Use LIMIT_NETDEBUG in some debugging printks

parent 5480855b
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -136,7 +136,8 @@ static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb)
		     DCCP_PKT_WITHOUT_ACK_SEQ))
		     DCCP_PKT_WITHOUT_ACK_SEQ))
			dp->dccps_gar = DCCP_SKB_CB(skb)->dccpd_ack_seq;
			dp->dccps_gar = DCCP_SKB_CB(skb)->dccpd_ack_seq;
	} else {
	} else {
		LIMIT_NETDEBUG("Step 6 failed, sending SYNC...\n");
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: Step 6 failed, "
					    "sending SYNC...\n");
		dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, DCCP_PKT_SYNC);
		dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, DCCP_PKT_SYNC);
		return -1;
		return -1;
	}
	}
@@ -168,7 +169,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
		if (dccp_ackpkts_add(dp->dccps_hc_rx_ackpkts,
		if (dccp_ackpkts_add(dp->dccps_hc_rx_ackpkts,
				     DCCP_SKB_CB(skb)->dccpd_seq,
				     DCCP_SKB_CB(skb)->dccpd_seq,
				     DCCP_ACKPKTS_STATE_RECEIVED)) {
				     DCCP_ACKPKTS_STATE_RECEIVED)) {
			LIMIT_NETDEBUG(KERN_INFO "DCCP: acknowledgeable "
			LIMIT_NETDEBUG(KERN_WARNING "DCCP: acknowledgeable "
						    "packets buffer full!\n");
						    "packets buffer full!\n");
			ap->dccpap_ack_seqno = DCCP_MAX_SEQNO + 1;
			ap->dccpap_ack_seqno = DCCP_MAX_SEQNO + 1;
			inet_csk_schedule_ack(sk);
			inet_csk_schedule_ack(sk);
+13 −10
Original line number Original line Diff line number Diff line
@@ -1008,7 +1008,7 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)
		return 1;
		return 1;


	if (!pskb_may_pull(skb, sizeof(struct dccp_hdr))) {
	if (!pskb_may_pull(skb, sizeof(struct dccp_hdr))) {
		printk(KERN_WARNING "DCCP: pskb_may_pull failed\n");
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: pskb_may_pull failed\n");
		return 1;
		return 1;
	}
	}


@@ -1016,7 +1016,7 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)


	/* If the packet type is not understood, drop packet and return */
	/* If the packet type is not understood, drop packet and return */
	if (dh->dccph_type >= DCCP_PKT_INVALID) {
	if (dh->dccph_type >= DCCP_PKT_INVALID) {
		printk(KERN_WARNING "DCCP: invalid packet type\n");
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: invalid packet type\n");
		return 1;
		return 1;
	}
	}


@@ -1025,13 +1025,15 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)
	 * packet, drop packet and return
	 * packet, drop packet and return
	 */
	 */
	if (dh->dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) {
	if (dh->dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) {
		printk(KERN_WARNING "DCCP: Offset(%u) too small 1\n",
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.Data Offset(%u) "
					    "too small 1\n",
			       dh->dccph_doff);
			       dh->dccph_doff);
		return 1;
		return 1;
	}
	}


	if (!pskb_may_pull(skb, dh->dccph_doff * sizeof(u32))) {
	if (!pskb_may_pull(skb, dh->dccph_doff * sizeof(u32))) {
		printk(KERN_WARNING "DCCP: P.Data Offset(%u) too small 2\n",
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.Data Offset(%u) "
					    "too small 2\n",
			       dh->dccph_doff);
			       dh->dccph_doff);
		return 1;
		return 1;
	}
	}
@@ -1046,8 +1048,8 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)
	    dh->dccph_type != DCCP_PKT_DATA &&
	    dh->dccph_type != DCCP_PKT_DATA &&
	    dh->dccph_type != DCCP_PKT_ACK &&
	    dh->dccph_type != DCCP_PKT_ACK &&
	    dh->dccph_type != DCCP_PKT_DATAACK) {
	    dh->dccph_type != DCCP_PKT_DATAACK) {
		printk(KERN_WARNING "DCCP: P.type (%s) not Data, Ack nor "
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.type (%s) not Data, Ack "
				    "DataAck and P.X == 0\n",
					    "nor DataAck and P.X == 0\n",
			       dccp_packet_name(dh->dccph_type));
			       dccp_packet_name(dh->dccph_type));
		return 1;
		return 1;
	}
	}
@@ -1055,7 +1057,8 @@ static inline int dccp_invalid_packet(struct sk_buff *skb)
	/* If the header checksum is incorrect, drop packet and return */
	/* If the header checksum is incorrect, drop packet and return */
	if (dccp_v4_verify_checksum(skb, skb->nh.iph->saddr,
	if (dccp_v4_verify_checksum(skb, skb->nh.iph->saddr,
				    skb->nh.iph->daddr) < 0) {
				    skb->nh.iph->daddr) < 0) {
		printk(KERN_WARNING "DCCP: header checksum is incorrect\n");
		LIMIT_NETDEBUG(KERN_WARNING "DCCP: header checksum is "
					    "incorrect\n");
		return 1;
		return 1;
	}
	}