aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r--net/dccp/options.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index f4ff0a308269..5adeeed5e0d2 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -429,9 +429,10 @@ static int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb)
429{ 429{
430 struct dccp_sock *dp = dccp_sk(sk); 430 struct dccp_sock *dp = dccp_sk(sk);
431 struct dccp_ackvec *av = dp->dccps_hc_rx_ackvec; 431 struct dccp_ackvec *av = dp->dccps_hc_rx_ackvec;
432 const u16 buflen = dccp_ackvec_buflen(av);
432 /* Figure out how many options do we need to represent the ackvec */ 433 /* Figure out how many options do we need to represent the ackvec */
433 const u8 nr_opts = DIV_ROUND_UP(av->av_vec_len, DCCP_SINGLE_OPT_MAXLEN); 434 const u8 nr_opts = DIV_ROUND_UP(buflen, DCCP_SINGLE_OPT_MAXLEN);
434 u16 len = av->av_vec_len + 2 * nr_opts; 435 u16 len = buflen + 2 * nr_opts;
435 u8 i, nonce = 0; 436 u8 i, nonce = 0;
436 const unsigned char *tail, *from; 437 const unsigned char *tail, *from;
437 unsigned char *to; 438 unsigned char *to;
@@ -442,7 +443,7 @@ static int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb)
442 DCCP_SKB_CB(skb)->dccpd_opt_len += len; 443 DCCP_SKB_CB(skb)->dccpd_opt_len += len;
443 444
444 to = skb_push(skb, len); 445 to = skb_push(skb, len);
445 len = av->av_vec_len; 446 len = buflen;
446 from = av->av_buf + av->av_buf_head; 447 from = av->av_buf + av->av_buf_head;
447 tail = av->av_buf + DCCPAV_MAX_ACKVEC_LEN; 448 tail = av->av_buf + DCCPAV_MAX_ACKVEC_LEN;
448 449
@@ -580,8 +581,7 @@ int dccp_insert_options(struct sock *sk, struct sk_buff *skb)
580 if (dccp_insert_option_timestamp(skb)) 581 if (dccp_insert_option_timestamp(skb))
581 return -1; 582 return -1;
582 583
583 } else if (dp->dccps_hc_rx_ackvec != NULL && 584 } else if (dccp_ackvec_pending(sk) &&
584 dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) &&
585 dccp_insert_option_ackvec(sk, skb)) { 585 dccp_insert_option_ackvec(sk, skb)) {
586 return -1; 586 return -1;
587 } 587 }