diff options
Diffstat (limited to 'net/dccp/ccids/ccid3.c')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 12b601f11bfd..4c422fb2189f 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -483,9 +483,8 @@ done_computing_x: | |||
483 | jiffies + usecs_to_jiffies(t_nfb)); | 483 | jiffies + usecs_to_jiffies(t_nfb)); |
484 | } | 484 | } |
485 | 485 | ||
486 | static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, | 486 | static int ccid3_hc_tx_parse_options(struct sock *sk, u8 packet_type, |
487 | unsigned char len, u16 idx, | 487 | u8 option, u8 *optval, u8 optlen) |
488 | unsigned char *value) | ||
489 | { | 488 | { |
490 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 489 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
491 | struct ccid3_options_received *opt_recv = &hctx->options_received; | 490 | struct ccid3_options_received *opt_recv = &hctx->options_received; |
@@ -494,12 +493,15 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, | |||
494 | switch (option) { | 493 | switch (option) { |
495 | case TFRC_OPT_RECEIVE_RATE: | 494 | case TFRC_OPT_RECEIVE_RATE: |
496 | case TFRC_OPT_LOSS_EVENT_RATE: | 495 | case TFRC_OPT_LOSS_EVENT_RATE: |
497 | if (unlikely(len != 4)) { | 496 | /* Must be ignored on Data packets, cf. RFC 4342 8.3 and 8.5 */ |
497 | if (packet_type == DCCP_PKT_DATA) | ||
498 | break; | ||
499 | if (unlikely(optlen != 4)) { | ||
498 | DCCP_WARN("%s(%p), invalid len %d for %u\n", | 500 | DCCP_WARN("%s(%p), invalid len %d for %u\n", |
499 | dccp_role(sk), sk, len, option); | 501 | dccp_role(sk), sk, optlen, option); |
500 | return -EINVAL; | 502 | return -EINVAL; |
501 | } | 503 | } |
502 | opt_val = ntohl(get_unaligned((__be32 *)value)); | 504 | opt_val = ntohl(get_unaligned((__be32 *)optval)); |
503 | 505 | ||
504 | if (option == TFRC_OPT_RECEIVE_RATE) { | 506 | if (option == TFRC_OPT_RECEIVE_RATE) { |
505 | opt_recv->ccid3or_receive_rate = opt_val; | 507 | opt_recv->ccid3or_receive_rate = opt_val; |