All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: dccp@vger.kernel.org
Subject: [PATCH] DCCP: Fix to handle short sequence numbers packet correctly
Date: Fri, 23 May 2008 01:08:48 +0000	[thread overview]
Message-ID: <48361920.9090309@cn.fujitsu.com> (raw)
In-Reply-To: <4834EA23.3070309@cn.fujitsu.com>

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.

This patch fixed this problem.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>

--- a/net/dccp/ipv4.c	2008-05-18 11:54:29.000000000 -0400
+++ b/net/dccp/ipv4.c	2008-05-18 11:55:51.000000000 -0400
@@ -741,8 +741,8 @@ int dccp_invalid_packet(struct sk_buff *
 	 * 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;





WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: Gerrit Renker <gerrit@erg.abdn.ac.uk>,
	David Miller <davem@davemloft.net>
Cc: Wei Yongjun <yjwei@cn.fujitsu.com>,
	dccp@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH] DCCP: Fix to handle short sequence numbers packet correctly
Date: Fri, 23 May 2008 09:08:48 +0800	[thread overview]
Message-ID: <48361920.9090309@cn.fujitsu.com> (raw)
In-Reply-To: <20080522090720.GA4827@gerrit.erg.abdn.ac.uk>

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.

This patch fixed this problem.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>

--- a/net/dccp/ipv4.c	2008-05-18 11:54:29.000000000 -0400
+++ b/net/dccp/ipv4.c	2008-05-18 11:55:51.000000000 -0400
@@ -741,8 +741,8 @@ int dccp_invalid_packet(struct sk_buff *
 	 * 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;





  parent reply	other threads:[~2008-05-23  1:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-22  3:36 [PATCH] DCCP: Fix to handle short sequence numbers packet correctly Wei Yongjun
2008-05-22  9:07 ` [PATCH] DCCP: Fix to handle short sequence numbers packet Gerrit Renker
2008-05-22  9:33 ` [PATCH] DCCP: Fix to handle short sequence numbers packet correctly Wei Yongjun
2008-05-22 10:07 ` [PATCH] DCCP: Fix to handle short sequence numbers packet Gerrit Renker
2008-05-23  1:08 ` Wei Yongjun [this message]
2008-05-23  1:08   ` [PATCH] DCCP: Fix to handle short sequence numbers packet correctly Wei Yongjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48361920.9090309@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=dccp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.