All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dccp: Reponsed with Reset when packet is received with invalid
@ 2008-08-20  1:20 Wei Yongjun
  2008-08-20 14:01   ` [PATCH] dccp: Reponsed with Reset when packet is received with invalid option Arnaldo Carvalho de Melo
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wei Yongjun @ 2008-08-20  1:20 UTC (permalink / raw)
  To: dccp

RFC4340 said that if a packet is received with invalid option(such as Mandatory
Option as the last byte of the option list), endpoint should reponsed with
Reset. In LISTIN state and RESPOND state, the endpoint reponsed with reset
correctly, but in REQUEST state and OPEN state, the endpoint just ignored
the packet. The packet sequence is as the following:

Case 1:

  Endpoint A                           Endpoint B
  (CLOSED)                             (CLOSED)

               <----------------       REQUEST

  RESPONSE     ----------------->      (*1)
  (with invalid option)
               <----------------       RESET
                                       (with Reset Code 5, "Option Error")

  (*1) it just be ignored currently, no reset is sent

Case 2:

  Endpoint A                           Endpoint B
  (OPEN)                               (OPEN)

  DATA-ACK     ----------------->      (*2)
  (with invalid option)
               <----------------       RESET
                                       (with Reset Code 5, "Option Error")

  (*2) it just be ignored currently, no reset is sent

This patch fixed the problem by reponsed with Reset instead of ignore packet.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/dccp/input.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dccp/input.c b/net/dccp/input.c
index dab4cc9..df0e671 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -370,7 +370,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb,
 		goto discard;
 
 	if (dccp_parse_options(sk, NULL, skb))
-		goto discard;
+		return 1;
 
 	dccp_handle_ackvec_processing(sk, skb);
 	dccp_deliver_input_to_ccids(sk, skb);
@@ -631,7 +631,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
 
 	/*  Step 8: Process options */
 	if (dccp_parse_options(sk, NULL, skb))
-		goto discard;
+		return 1;
 
 	/*
 	 *  Step 9: Process Reset
-- 
1.5.3.8




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-23 10:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20  1:20 [PATCH] dccp: Reponsed with Reset when packet is received with invalid Wei Yongjun
2008-08-20 14:01 ` [PATCH] dccp: Reponsed with Reset when packet is received with Arnaldo Carvalho de Melo
2008-08-20 14:01   ` [PATCH] dccp: Reponsed with Reset when packet is received with invalid option Arnaldo Carvalho de Melo
2008-08-20 17:34 ` [PATCH] dccp: Reponsed with Reset when packet is received with Gerrit Renker
2008-08-22  1:44 ` Wei Yongjun
2008-08-23 10:50 ` Gerrit Renker

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.