Skip to contentSkip to conversation

DCCP: Fix to handle short sequence numbers packet correctly

PATCH In review Wei Yongjun 2 participants 5 messages May 22, 2008 – May 23, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

This patch fixed this problem.

net/dccp/ipv4.c +2 -2
@@ -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;
Acked-by on v1 1/1
#1 lore raw

Re: [PATCH] DCCP: Fix to handle short sequence numbers packet

Quoted 6 lines

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.

I also put this patch into the test tree, as long as it is not in mainline.

#2 lore raw

PATCH 1/1 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.

This patch fixed this problem.

net/dccp/ipv4.c +0 -0
@@ -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;
#3 lore raw
In reply to Wei Yongjun

Hi Gerrit Renker:

Does this patch need CC to netdev?

Wei Yongjun

Quoted 13 lines · Gerrit Renker
Quoted 7 lines

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.

I also put this patch into the test tree, as long as it is not in mainline.

#4 lore raw

Re: [PATCH] DCCP: Fix to handle short sequence numbers packet

In reply to Wei Yongjun
Quoted 3 lines

Does this patch need CC to netdev?

Yes, please send patches to both mailing lists.