[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    dccp: Fix to handle short sequence numbers packet correctly
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2008-05-30 14:59:11
Message-ID: 200805301459.m4UExB6F025828 () hera ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6079a463cf95fafcc704a4e5e92a4da12444bd3c
Commit:     6079a463cf95fafcc704a4e5e92a4da12444bd3c
Parent:     289c79a4bd350e8a25065102563ad1a183d1b402
Author:     Wei Yongjun <yjwei@cn.fujitsu.com>
AuthorDate: Tue May 27 06:22:38 2008 -0700
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Tue May 27 06:22:38 2008 -0700

    dccp: Fix to handle short sequence numbers packet correctly
    
    RFC4340 said:
      8.5.  Pseudocode
           ...
           If P.type is not Data, Ack, or DataAck and P.X == 0 (the packet
                 has short sequence numbers), drop packet and return
    
    But DCCP has some mistake to handle short sequence numbers packet, now
    it drop packet only if P.type is Data, Ack, or DataAck and P.X == 0.
    
    Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
    Acked-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
    Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/dccp/ipv4.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index b348dd7..c22a378 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -739,8 +739,8 @@ int dccp_invalid_packet(struct sk_buff *skb)
 	 * If P.type is not Data, Ack, or DataAck and P.X == 0 (the packet
 	 * has short sequence numbers), drop packet and return
 	 */
-	if (dh->dccph_type >= DCCP_PKT_DATA    &&
-	    dh->dccph_type <= DCCP_PKT_DATAACK && dh->dccph_x == 0)  {
+	if ((dh->dccph_type < DCCP_PKT_DATA    ||
+	    dh->dccph_type > DCCP_PKT_DATAACK) && dh->dccph_x == 0)  {
 		DCCP_WARN("P.type (%s) not Data || [Data]Ack, while P.X == 0\n",
 			  dccp_packet_name(dh->dccph_type));
 		return 1;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic