DCCP protocol discussions
 help / color / mirror / Atom feed
* [PATCH 3/5]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also
@ 2007-09-12 14:35 Gerrit Renker
  2007-09-13  0:23 ` Ian McDonald
  0 siblings, 1 reply; 2+ messages in thread
From: Gerrit Renker @ 2007-09-12 14:35 UTC (permalink / raw)
  To: dccp

[DCCP]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also

Small update with regard to RFC 4340 (references added as documentation):
on Requests, Ack Vectors / Elapsed Time should be ignored.
Length handling of Elapsed Time also simplified.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>						
---
 net/dccp/options.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -128,7 +128,7 @@ int dccp_parse_options(struct sock *sk, 
 			break;
 		case DCCPO_ACK_VECTOR_0:
 		case DCCPO_ACK_VECTOR_1:
-			if (pkt_type = DCCP_PKT_DATA)
+			if (dccp_packet_without_ack(skb))   /* RFC 4340, 11.4 */
 				break;
 
 			if (dccp_msk(sk)->dccpms_send_ack_vector &&
@@ -186,19 +186,17 @@ int dccp_parse_options(struct sock *sk, 
 				opt_recv->dccpor_elapsed_time = elapsed_time;
 			break;
 		case DCCPO_ELAPSED_TIME:
-			if (len != 2 && len != 4)
-				goto out_invalid_option;
-
-			if (pkt_type = DCCP_PKT_DATA)
-				continue;
+			if (dccp_packet_without_ack(skb))   /* RFC 4340, 13.2 */
+				break;
 
 			if (len = 2) {
 				opt_val = get_unaligned((u16 *)value);
 				elapsed_time = ntohs((u16)opt_val);
-			} else {
+			} else if (len = 4) {
 				opt_val = get_unaligned((u32 *)value);
 				elapsed_time = ntohl(opt_val);
-			}
+			} else
+				goto out_invalid_option;
 
 			if (elapsed_time > opt_recv->dccpor_elapsed_time)
 				opt_recv->dccpor_elapsed_time = elapsed_time;

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

* Re: [PATCH 3/5]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also
  2007-09-12 14:35 [PATCH 3/5]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also Gerrit Renker
@ 2007-09-13  0:23 ` Ian McDonald
  0 siblings, 0 replies; 2+ messages in thread
From: Ian McDonald @ 2007-09-13  0:23 UTC (permalink / raw)
  To: dccp

On 9/13/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [DCCP]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also
>
> Small update with regard to RFC 4340 (references added as documentation):
> on Requests, Ack Vectors / Elapsed Time should be ignored.
> Length handling of Elapsed Time also simplified.
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>

Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
-- 
Web1: http://wand.net.nz/~iam4/
Web2: http://www.jandi.co.nz
Blog: http://iansblog.jandi.co.nz

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

end of thread, other threads:[~2007-09-13  0:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12 14:35 [PATCH 3/5]: Ignore Ack Vectors / Elapsed Time on DCCP-Request also Gerrit Renker
2007-09-13  0:23 ` Ian McDonald

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