diff options
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r-- | net/dccp/options.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c index bfda087bd90d..cd3061813009 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -96,18 +96,11 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | /* | 98 | /* |
99 | * CCID-Specific Options (from RFC 4340, sec. 10.3): | ||
100 | * | ||
101 | * Option numbers 128 through 191 are for options sent from the | ||
102 | * HC-Sender to the HC-Receiver; option numbers 192 through 255 | ||
103 | * are for options sent from the HC-Receiver to the HC-Sender. | ||
104 | * | ||
105 | * CCID-specific options are ignored during connection setup, as | 99 | * CCID-specific options are ignored during connection setup, as |
106 | * negotiation may still be in progress (see RFC 4340, 10.3). | 100 | * negotiation may still be in progress (see RFC 4340, 10.3). |
107 | * The same applies to Ack Vectors, as these depend on the CCID. | 101 | * The same applies to Ack Vectors, as these depend on the CCID. |
108 | * | ||
109 | */ | 102 | */ |
110 | if (dreq != NULL && (opt >= 128 || | 103 | if (dreq != NULL && (opt >= DCCPO_MIN_RX_CCID_SPECIFIC || |
111 | opt == DCCPO_ACK_VECTOR_0 || opt == DCCPO_ACK_VECTOR_1)) | 104 | opt == DCCPO_ACK_VECTOR_0 || opt == DCCPO_ACK_VECTOR_1)) |
112 | goto ignore_option; | 105 | goto ignore_option; |
113 | 106 | ||
@@ -170,6 +163,8 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
170 | dccp_role(sk), ntohl(opt_val), | 163 | dccp_role(sk), ntohl(opt_val), |
171 | (unsigned long long) | 164 | (unsigned long long) |
172 | DCCP_SKB_CB(skb)->dccpd_ack_seq); | 165 | DCCP_SKB_CB(skb)->dccpd_ack_seq); |
166 | /* schedule an Ack in case this sender is quiescent */ | ||
167 | inet_csk_schedule_ack(sk); | ||
173 | break; | 168 | break; |
174 | case DCCPO_TIMESTAMP_ECHO: | 169 | case DCCPO_TIMESTAMP_ECHO: |
175 | if (len != 4 && len != 6 && len != 8) | 170 | if (len != 4 && len != 6 && len != 8) |
@@ -226,23 +221,15 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq, | |||
226 | dccp_pr_debug("%s rx opt: ELAPSED_TIME=%d\n", | 221 | dccp_pr_debug("%s rx opt: ELAPSED_TIME=%d\n", |
227 | dccp_role(sk), elapsed_time); | 222 | dccp_role(sk), elapsed_time); |
228 | break; | 223 | break; |
229 | case 128 ... 191: { | 224 | case DCCPO_MIN_RX_CCID_SPECIFIC ... DCCPO_MAX_RX_CCID_SPECIFIC: |
230 | const u16 idx = value - options; | ||
231 | |||
232 | if (ccid_hc_rx_parse_options(dp->dccps_hc_rx_ccid, sk, | 225 | if (ccid_hc_rx_parse_options(dp->dccps_hc_rx_ccid, sk, |
233 | opt, len, idx, | 226 | pkt_type, opt, value, len)) |
234 | value) != 0) | ||
235 | goto out_invalid_option; | 227 | goto out_invalid_option; |
236 | } | ||
237 | break; | 228 | break; |
238 | case 192 ... 255: { | 229 | case DCCPO_MIN_TX_CCID_SPECIFIC ... DCCPO_MAX_TX_CCID_SPECIFIC: |
239 | const u16 idx = value - options; | ||
240 | |||
241 | if (ccid_hc_tx_parse_options(dp->dccps_hc_tx_ccid, sk, | 230 | if (ccid_hc_tx_parse_options(dp->dccps_hc_tx_ccid, sk, |
242 | opt, len, idx, | 231 | pkt_type, opt, value, len)) |
243 | value) != 0) | ||
244 | goto out_invalid_option; | 232 | goto out_invalid_option; |
245 | } | ||
246 | break; | 233 | break; |
247 | default: | 234 | default: |
248 | DCCP_CRIT("DCCP(%p): option %d(len=%d) not " | 235 | 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) | |||
384 | 371 | ||
385 | EXPORT_SYMBOL_GPL(dccp_insert_option_elapsed_time); | 372 | EXPORT_SYMBOL_GPL(dccp_insert_option_elapsed_time); |
386 | 373 | ||
387 | int dccp_insert_option_timestamp(struct sk_buff *skb) | 374 | static int dccp_insert_option_timestamp(struct sk_buff *skb) |
388 | { | 375 | { |
389 | __be32 now = htonl(dccp_timestamp()); | 376 | __be32 now = htonl(dccp_timestamp()); |
390 | /* yes this will overflow but that is the point as we want a | 377 | /* 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) | |||
393 | return dccp_insert_option(skb, DCCPO_TIMESTAMP, &now, sizeof(now)); | 380 | return dccp_insert_option(skb, DCCPO_TIMESTAMP, &now, sizeof(now)); |
394 | } | 381 | } |
395 | 382 | ||
396 | EXPORT_SYMBOL_GPL(dccp_insert_option_timestamp); | ||
397 | |||
398 | static int dccp_insert_option_timestamp_echo(struct dccp_sock *dp, | 383 | static int dccp_insert_option_timestamp_echo(struct dccp_sock *dp, |
399 | struct dccp_request_sock *dreq, | 384 | struct dccp_request_sock *dreq, |
400 | struct sk_buff *skb) | 385 | struct sk_buff *skb) |