aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 7114befe7d50..ff81679c9f17 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -747,7 +747,7 @@ int dccp_invalid_packet(struct sk_buff *skb)
747 747
748 /* If the packet is shorter than 12 bytes, drop packet and return */ 748 /* If the packet is shorter than 12 bytes, drop packet and return */
749 if (!pskb_may_pull(skb, sizeof(struct dccp_hdr))) { 749 if (!pskb_may_pull(skb, sizeof(struct dccp_hdr))) {
750 LIMIT_NETDEBUG(KERN_WARNING "DCCP: pskb_may_pull failed\n"); 750 DCCP_WARN("pskb_may_pull failed\n");
751 return 1; 751 return 1;
752 } 752 }
753 753
@@ -755,7 +755,7 @@ int dccp_invalid_packet(struct sk_buff *skb)
755 755
756 /* If P.type is not understood, drop packet and return */ 756 /* If P.type is not understood, drop packet and return */
757 if (dh->dccph_type >= DCCP_PKT_INVALID) { 757 if (dh->dccph_type >= DCCP_PKT_INVALID) {
758 LIMIT_NETDEBUG(KERN_WARNING "DCCP: invalid packet type\n"); 758 DCCP_WARN("invalid packet type\n");
759 return 1; 759 return 1;
760 } 760 }
761 761
@@ -763,16 +763,14 @@ int dccp_invalid_packet(struct sk_buff *skb)
763 * If P.Data Offset is too small for packet type, drop packet and return 763 * If P.Data Offset is too small for packet type, drop packet and return
764 */ 764 */
765 if (dh->dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) { 765 if (dh->dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) {
766 LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.Data Offset(%u) " 766 DCCP_WARN("P.Data Offset(%u) too small\n", dh->dccph_doff);
767 "too small\n", dh->dccph_doff);
768 return 1; 767 return 1;
769 } 768 }
770 /* 769 /*
771 * If P.Data Offset is too too large for packet, drop packet and return 770 * If P.Data Offset is too too large for packet, drop packet and return
772 */ 771 */
773 if (!pskb_may_pull(skb, dh->dccph_doff * sizeof(u32))) { 772 if (!pskb_may_pull(skb, dh->dccph_doff * sizeof(u32))) {
774 LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.Data Offset(%u) " 773 DCCP_WARN("P.Data Offset(%u) too large\n", dh->dccph_doff);
775 "too large\n", dh->dccph_doff);
776 return 1; 774 return 1;
777 } 775 }
778 776
@@ -782,9 +780,8 @@ int dccp_invalid_packet(struct sk_buff *skb)
782 */ 780 */
783 if (dh->dccph_type >= DCCP_PKT_DATA && 781 if (dh->dccph_type >= DCCP_PKT_DATA &&
784 dh->dccph_type <= DCCP_PKT_DATAACK && dh->dccph_x == 0) { 782 dh->dccph_type <= DCCP_PKT_DATAACK && dh->dccph_x == 0) {
785 LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.type (%s) not Data||Ack||" 783 DCCP_WARN("P.type (%s) not Data || [Data]Ack, while P.X == 0\n",
786 "DataAck, while P.X == 0\n", 784 dccp_packet_name(dh->dccph_type));
787 dccp_packet_name(dh->dccph_type));
788 return 1; 785 return 1;
789 } 786 }
790 787
@@ -794,9 +791,8 @@ int dccp_invalid_packet(struct sk_buff *skb)
794 */ 791 */
795 cscov = dccp_csum_coverage(skb); 792 cscov = dccp_csum_coverage(skb);
796 if (cscov > skb->len) { 793 if (cscov > skb->len) {
797 LIMIT_NETDEBUG(KERN_WARNING 794 DCCP_WARN("P.CsCov %u exceeds packet length %d\n",
798 "DCCP: P.CsCov %u exceeds packet length %d\n", 795 dh->dccph_cscov, skb->len);
799 dh->dccph_cscov, skb->len);
800 return 1; 796 return 1;
801 } 797 }
802 798
@@ -823,9 +819,7 @@ static int dccp_v4_rcv(struct sk_buff *skb)
823 819
824 /* Step 1: If header checksum is incorrect, drop packet and return */ 820 /* Step 1: If header checksum is incorrect, drop packet and return */
825 if (dccp_v4_csum_finish(skb, skb->nh.iph->saddr, skb->nh.iph->daddr)) { 821 if (dccp_v4_csum_finish(skb, skb->nh.iph->saddr, skb->nh.iph->daddr)) {
826 LIMIT_NETDEBUG(KERN_WARNING 822 DCCP_WARN("dropped packet with invalid checksum\n");
827 "%s: dropped packet with invalid checksum\n",
828 __FUNCTION__);
829 goto discard_it; 823 goto discard_it;
830 } 824 }
831 825