DCCP protocol discussions
 help / color / mirror / Atom feed
* Re: [PATCH] Mandatory Option Draft Cleanup
@ 2006-02-22 11:38 Hagen Paul Pfeifer
  2006-02-28 20:15 ` Hagen Paul Pfeifer
  2006-02-28 20:28 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: Hagen Paul Pfeifer @ 2006-02-22 11:38 UTC (permalink / raw)
  To: dccp


Sorry for the non-informative subject line! ;-)

HGN


-- 
Living on Earth may be expensive, but it includes
an annual free trip around the Sun.

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

* [PATCH] Mandatory Option Draft Cleanup
  2006-02-22 11:38 [PATCH] Mandatory Option Draft Cleanup Hagen Paul Pfeifer
@ 2006-02-28 20:15 ` Hagen Paul Pfeifer
  2006-02-28 20:28 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Hagen Paul Pfeifer @ 2006-02-28 20:15 UTC (permalink / raw)
  To: dccp

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]


According to dccp draft (draft-ietf-dccp-spec-13.txt) section 5.8.2 (Mandatory
Option) the following patch correct the handling of the following cases:

1) "... and any Mandatory options received on DCCP-Data packets MUST be
   ignored."

2) "The connection is in error and should be reset with Reset Code 5, ...
   if option O is absent (Mandatory was the last byte of the option list), or
   if option O equals Mandatory."


Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>



[-- Attachment #2: mandatory.patch --]
[-- Type: text/plain, Size: 635 bytes --]

diff --git a/net/dccp/options.c b/net/dccp/options.c
index 7d73b33..3db9aad 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -107,7 +107,8 @@ int dccp_parse_options(struct sock *sk, 
 		case DCCPO_MANDATORY:
 			if (mandatory)
 				goto out_invalid_option;
-			mandatory = 1;
+			if (pkt_type != DCCP_PKT_DATA)
+				mandatory = 1;
 			break;
 		case DCCPO_NDP_COUNT:
 			if (len > 3)
@@ -247,6 +248,10 @@ int dccp_parse_options(struct sock *sk, 
 			mandatory = 0;
 	}
 
+	/* mandatory was the last byte in option list -> reset connection */
+	if (mandatory)
+		goto out_invalid_option;
+
 	return 0;
 
 out_invalid_option:

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

* Re: [PATCH] Mandatory Option Draft Cleanup
  2006-02-22 11:38 [PATCH] Mandatory Option Draft Cleanup Hagen Paul Pfeifer
  2006-02-28 20:15 ` Hagen Paul Pfeifer
@ 2006-02-28 20:28 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2006-02-28 20:28 UTC (permalink / raw)
  To: dccp

On 2/28/06, Hagen Paul Pfeifer <hagen@jauu.net> wrote:
>
> According to dccp draft (draft-ietf-dccp-spec-13.txt) section 5.8.2 (Mandatory
> Option) the following patch correct the handling of the following cases:
>
> 1) "... and any Mandatory options received on DCCP-Data packets MUST be
>    ignored."
>
> 2) "The connection is in error and should be reset with Reset Code 5, ...
>    if option O is absent (Mandatory was the last byte of the option list), or
>    if option O equals Mandatory."
>
>
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>

Thanks, I got this one merged already, take a look at:

http://www.kernel.org/git/?p=linux/kernel/git/acme/net-2.6.17.git;a=summary

Will submit to Dave later today.

- Arnaldo

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

end of thread, other threads:[~2006-02-28 20:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-22 11:38 [PATCH] Mandatory Option Draft Cleanup Hagen Paul Pfeifer
2006-02-28 20:15 ` Hagen Paul Pfeifer
2006-02-28 20:28 ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox