Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c86ab2b6a5deec2223a606b90c001bedda9d950b
Commit:     c86ab2b6a5deec2223a606b90c001bedda9d950b
Parent:     6d57b43bf810cd66ccf252c04ba65c3e8e56cbb1
Author:     Gerrit Renker <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 21 10:13:53 2007 -0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:54:47 2008 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Ian McDonald <[EMAIL PROTECTED]>
    Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/dccp/options.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/dccp/options.c b/net/dccp/options.c
index d286cff..523250b 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -136,7 +136,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
                        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 &&
@@ -194,18 +194,17 @@ int dccp_parse_options(struct sock *sk, struct sk_buff 
*skb)
                                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) {
                                __be16 opt_val2 = get_unaligned((__be16 
*)value);
                                elapsed_time = ntohs(opt_val2);
-                       } else {
+                       } else if (len == 4) {
                                opt_val = get_unaligned((__be32 *)value);
                                elapsed_time = ntohl(opt_val);
+                       } else {
+                               goto out_invalid_option;
                        }
 
                        if (elapsed_time > opt_recv->dccpor_elapsed_time)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to