diff options
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r-- | net/dccp/output.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c index 809d803d5006..22a618af4893 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -175,7 +175,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu) | |||
175 | * make it a multiple of 4 | 175 | * make it a multiple of 4 |
176 | */ | 176 | */ |
177 | 177 | ||
178 | cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4; | 178 | cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6, 4); |
179 | 179 | ||
180 | /* And store cached results */ | 180 | /* And store cached results */ |
181 | icsk->icsk_pmtu_cookie = pmtu; | 181 | icsk->icsk_pmtu_cookie = pmtu; |
@@ -339,10 +339,12 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | |||
339 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE; | 339 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE; |
340 | DCCP_SKB_CB(skb)->dccpd_seq = dreq->dreq_iss; | 340 | DCCP_SKB_CB(skb)->dccpd_seq = dreq->dreq_iss; |
341 | 341 | ||
342 | if (dccp_insert_options_rsk(dreq, skb)) { | 342 | /* Resolve feature dependencies resulting from choice of CCID */ |
343 | kfree_skb(skb); | 343 | if (dccp_feat_server_ccid_dependencies(dreq)) |
344 | return NULL; | 344 | goto response_failed; |
345 | } | 345 | |
346 | if (dccp_insert_options_rsk(dreq, skb)) | ||
347 | goto response_failed; | ||
346 | 348 | ||
347 | /* Build and checksum header */ | 349 | /* Build and checksum header */ |
348 | dh = dccp_zeroed_hdr(skb, dccp_header_size); | 350 | dh = dccp_zeroed_hdr(skb, dccp_header_size); |
@@ -363,6 +365,9 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | |||
363 | inet_rsk(req)->acked = 1; | 365 | inet_rsk(req)->acked = 1; |
364 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); | 366 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); |
365 | return skb; | 367 | return skb; |
368 | response_failed: | ||
369 | kfree_skb(skb); | ||
370 | return NULL; | ||
366 | } | 371 | } |
367 | 372 | ||
368 | EXPORT_SYMBOL_GPL(dccp_make_response); | 373 | EXPORT_SYMBOL_GPL(dccp_make_response); |
@@ -469,6 +474,10 @@ int dccp_connect(struct sock *sk) | |||
469 | struct sk_buff *skb; | 474 | struct sk_buff *skb; |
470 | struct inet_connection_sock *icsk = inet_csk(sk); | 475 | struct inet_connection_sock *icsk = inet_csk(sk); |
471 | 476 | ||
477 | /* do not connect if feature negotiation setup fails */ | ||
478 | if (dccp_feat_finalise_settings(dccp_sk(sk))) | ||
479 | return -EPROTO; | ||
480 | |||
472 | dccp_connect_init(sk); | 481 | dccp_connect_init(sk); |
473 | 482 | ||
474 | skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation); | 483 | skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation); |