]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/dccp/minisocks.c
[DCCP]: Use sk->sk_prot->max_header consistently for non-data packets
[linux-2.6-omap-h63xx.git] / net / dccp / minisocks.c
index 29261fc198e76161215d275109ba7163390901db..5324fcacb34d5c7b139efcb6a88f57a0c4ba10fa 100644 (file)
@@ -22,6 +22,7 @@
 #include "ackvec.h"
 #include "ccid.h"
 #include "dccp.h"
+#include "feat.h"
 
 struct inet_timewait_death_row dccp_death_row = {
        .sysctl_max_tw_buckets = NR_FILE * 2,
@@ -114,27 +115,27 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
                newicsk->icsk_rto          = DCCP_TIMEOUT_INIT;
                do_gettimeofday(&newdp->dccps_epoch);
 
+               if (dccp_feat_clone(sk, newsk))
+                       goto out_free;
+
                if (newdp->dccps_options.dccpo_send_ack_vector) {
                        newdp->dccps_hc_rx_ackvec =
-                               dccp_ackvec_alloc(DCCP_MAX_ACKVEC_LEN,
-                                                 GFP_ATOMIC);
-                       /*
-                        * XXX: We're using the same CCIDs set on the parent,
-                        * i.e. sk_clone copied the master sock and left the
-                        * CCID pointers for this child, that is why we do the
-                        * __ccid_get calls.
-                        */
+                                               dccp_ackvec_alloc(GFP_ATOMIC);
                        if (unlikely(newdp->dccps_hc_rx_ackvec == NULL))
                                goto out_free;
                }
 
-               if (unlikely(ccid_hc_rx_init(newdp->dccps_hc_rx_ccid,
-                                            newsk) != 0 ||
-                            ccid_hc_tx_init(newdp->dccps_hc_tx_ccid,
-                                            newsk) != 0)) {
+               newdp->dccps_hc_rx_ccid =
+                           ccid_hc_rx_new(newdp->dccps_options.dccpo_rx_ccid,
+                                          newsk, GFP_ATOMIC);
+               newdp->dccps_hc_tx_ccid =
+                           ccid_hc_tx_new(newdp->dccps_options.dccpo_tx_ccid,
+                                          newsk, GFP_ATOMIC);
+               if (unlikely(newdp->dccps_hc_rx_ccid == NULL ||
+                            newdp->dccps_hc_tx_ccid == NULL)) {
                        dccp_ackvec_free(newdp->dccps_hc_rx_ackvec);
-                       ccid_hc_rx_exit(newdp->dccps_hc_rx_ccid, newsk);
-                       ccid_hc_tx_exit(newdp->dccps_hc_tx_ccid, newsk);
+                       ccid_hc_rx_delete(newdp->dccps_hc_rx_ccid, newsk);
+                       ccid_hc_tx_delete(newdp->dccps_hc_tx_ccid, newsk);
 out_free:
                        /* It is still raw copy of parent, so invalidate
                         * destructor and make plain sk_free() */
@@ -143,9 +144,6 @@ out_free:
                        return NULL;
                }
 
-               __ccid_get(newdp->dccps_hc_rx_ccid);
-               __ccid_get(newdp->dccps_hc_tx_ccid);
-
                /*
                 * Step 3: Process LISTEN state
                 *