]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/dccp/options.c
dccp: schedule an Ack when receiving timestamps
[net-next-2.6.git] / net / dccp / options.c
index bfda087bd90dd792f8190840878379d304152c1d..cd306181300940f924b682c9f77e5881323ce6a0 100644 (file)
@@ -96,18 +96,11 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
                }
 
                /*
-                * CCID-Specific Options (from RFC 4340, sec. 10.3):
-                *
-                * Option numbers 128 through 191 are for options sent from the
-                * HC-Sender to the HC-Receiver; option numbers 192 through 255
-                * are for options sent from the HC-Receiver to the HC-Sender.
-                *
                 * CCID-specific options are ignored during connection setup, as
                 * negotiation may still be in progress (see RFC 4340, 10.3).
                 * The same applies to Ack Vectors, as these depend on the CCID.
-                *
                 */
-               if (dreq != NULL && (opt >= 128 ||
+               if (dreq != NULL && (opt >= DCCPO_MIN_RX_CCID_SPECIFIC ||
                    opt == DCCPO_ACK_VECTOR_0 || opt == DCCPO_ACK_VECTOR_1))
                        goto ignore_option;
 
@@ -170,6 +163,8 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
                                      dccp_role(sk), ntohl(opt_val),
                                      (unsigned long long)
                                      DCCP_SKB_CB(skb)->dccpd_ack_seq);
+                       /* schedule an Ack in case this sender is quiescent */
+                       inet_csk_schedule_ack(sk);
                        break;
                case DCCPO_TIMESTAMP_ECHO:
                        if (len != 4 && len != 6 && len != 8)
@@ -226,23 +221,15 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
                        dccp_pr_debug("%s rx opt: ELAPSED_TIME=%d\n",
                                      dccp_role(sk), elapsed_time);
                        break;
-               case 128 ... 191: {
-                       const u16 idx = value - options;
-
+               case DCCPO_MIN_RX_CCID_SPECIFIC ... DCCPO_MAX_RX_CCID_SPECIFIC:
                        if (ccid_hc_rx_parse_options(dp->dccps_hc_rx_ccid, sk,
-                                                    opt, len, idx,
-                                                    value) != 0)
+                                                    pkt_type, opt, value, len))
                                goto out_invalid_option;
-               }
                        break;
-               case 192 ... 255: {
-                       const u16 idx = value - options;
-
+               case DCCPO_MIN_TX_CCID_SPECIFIC ... DCCPO_MAX_TX_CCID_SPECIFIC:
                        if (ccid_hc_tx_parse_options(dp->dccps_hc_tx_ccid, sk,
-                                                    opt, len, idx,
-                                                    value) != 0)
+                                                    pkt_type, opt, value, len))
                                goto out_invalid_option;
-               }
                        break;
                default:
                        DCCP_CRIT("DCCP(%p): option %d(len=%d) not "
@@ -384,7 +371,7 @@ int dccp_insert_option_elapsed_time(struct sk_buff *skb, u32 elapsed_time)
 
 EXPORT_SYMBOL_GPL(dccp_insert_option_elapsed_time);
 
-int dccp_insert_option_timestamp(struct sk_buff *skb)
+static int dccp_insert_option_timestamp(struct sk_buff *skb)
 {
        __be32 now = htonl(dccp_timestamp());
        /* yes this will overflow but that is the point as we want a
@@ -393,8 +380,6 @@ int dccp_insert_option_timestamp(struct sk_buff *skb)
        return dccp_insert_option(skb, DCCPO_TIMESTAMP, &now, sizeof(now));
 }
 
-EXPORT_SYMBOL_GPL(dccp_insert_option_timestamp);
-
 static int dccp_insert_option_timestamp_echo(struct dccp_sock *dp,
                                             struct dccp_request_sock *dreq,
                                             struct sk_buff *skb)