perf_counter: Add dummy perf_counter_print_debug function
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / dccp / output.c
index 809d803d5006ec6614821b9d0d48b63cf131a31f..22a618af48936aa9954978cdf8d94117e02d7bac 100644 (file)
@@ -175,7 +175,7 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
         * make it a multiple of 4
         */
 
-       cur_mps -= ((5 + 6 + 10 + 6 + 6 + 6 + 3) / 4) * 4;
+       cur_mps -= roundup(5 + 6 + 10 + 6 + 6 + 6, 4);
 
        /* And store cached results */
        icsk->icsk_pmtu_cookie = pmtu;
@@ -339,10 +339,12 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
        DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE;
        DCCP_SKB_CB(skb)->dccpd_seq  = dreq->dreq_iss;
 
-       if (dccp_insert_options_rsk(dreq, skb)) {
-               kfree_skb(skb);
-               return NULL;
-       }
+       /* Resolve feature dependencies resulting from choice of CCID */
+       if (dccp_feat_server_ccid_dependencies(dreq))
+               goto response_failed;
+
+       if (dccp_insert_options_rsk(dreq, skb))
+               goto response_failed;
 
        /* Build and checksum header */
        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,
        inet_rsk(req)->acked = 1;
        DCCP_INC_STATS(DCCP_MIB_OUTSEGS);
        return skb;
+response_failed:
+       kfree_skb(skb);
+       return NULL;
 }
 
 EXPORT_SYMBOL_GPL(dccp_make_response);
@@ -469,6 +474,10 @@ int dccp_connect(struct sock *sk)
        struct sk_buff *skb;
        struct inet_connection_sock *icsk = inet_csk(sk);
 
+       /* do not connect if feature negotiation setup fails */
+       if (dccp_feat_finalise_settings(dccp_sk(sk)))
+               return -EPROTO;
+
        dccp_connect_init(sk);
 
        skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation);