aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/dccp/minisocks.c42
1 files changed, 12 insertions, 30 deletions
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index ed61bc58e41e..308b6b928c3d 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -111,7 +111,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
111 struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC); 111 struct sock *newsk = inet_csk_clone(sk, req, GFP_ATOMIC);
112 112
113 if (newsk != NULL) { 113 if (newsk != NULL) {
114 const struct dccp_request_sock *dreq = dccp_rsk(req); 114 struct dccp_request_sock *dreq = dccp_rsk(req);
115 struct inet_connection_sock *newicsk = inet_csk(newsk); 115 struct inet_connection_sock *newicsk = inet_csk(newsk);
116 struct dccp_sock *newdp = dccp_sk(newsk); 116 struct dccp_sock *newdp = dccp_sk(newsk);
117 struct dccp_minisock *newdmsk = dccp_msk(newsk); 117 struct dccp_minisock *newdmsk = dccp_msk(newsk);
@@ -125,35 +125,6 @@ struct sock *dccp_create_openreq_child(struct sock *sk,
125 newicsk->icsk_rto = DCCP_TIMEOUT_INIT; 125 newicsk->icsk_rto = DCCP_TIMEOUT_INIT;
126 126
127 INIT_LIST_HEAD(&newdp->dccps_featneg); 127 INIT_LIST_HEAD(&newdp->dccps_featneg);
128 if (dccp_feat_clone(sk, newsk))
129 goto out_free;
130
131 if (newdmsk->dccpms_send_ack_vector) {
132 newdp->dccps_hc_rx_ackvec =
133 dccp_ackvec_alloc(GFP_ATOMIC);
134 if (unlikely(newdp->dccps_hc_rx_ackvec == NULL))
135 goto out_free;
136 }
137
138 newdp->dccps_hc_rx_ccid =
139 ccid_hc_rx_new(newdmsk->dccpms_rx_ccid,
140 newsk, GFP_ATOMIC);
141 newdp->dccps_hc_tx_ccid =
142 ccid_hc_tx_new(newdmsk->dccpms_tx_ccid,
143 newsk, GFP_ATOMIC);
144 if (unlikely(newdp->dccps_hc_rx_ccid == NULL ||
145 newdp->dccps_hc_tx_ccid == NULL)) {
146 dccp_ackvec_free(newdp->dccps_hc_rx_ackvec);
147 ccid_hc_rx_delete(newdp->dccps_hc_rx_ccid, newsk);
148 ccid_hc_tx_delete(newdp->dccps_hc_tx_ccid, newsk);
149out_free:
150 /* It is still raw copy of parent, so invalidate
151 * destructor and make plain sk_free() */
152 newsk->sk_destruct = NULL;
153 sk_free(newsk);
154 return NULL;
155 }
156
157 /* 128 /*
158 * Step 3: Process LISTEN state 129 * Step 3: Process LISTEN state
159 * 130 *
@@ -184,6 +155,17 @@ out_free:
184 dccp_set_seqno(&newdp->dccps_awl, 155 dccp_set_seqno(&newdp->dccps_awl,
185 max48(newdp->dccps_awl, newdp->dccps_iss)); 156 max48(newdp->dccps_awl, newdp->dccps_iss));
186 157
158 /*
159 * Activate features after initialising the sequence numbers,
160 * since CCID initialisation may depend on GSS, ISR, ISS etc.
161 */
162 if (dccp_feat_activate_values(newsk, &dreq->dreq_featneg)) {
163 /* It is still raw copy of parent, so invalidate
164 * destructor and make plain sk_free() */
165 newsk->sk_destruct = NULL;
166 sk_free(newsk);
167 return NULL;
168 }
187 dccp_init_xmit_timers(newsk); 169 dccp_init_xmit_timers(newsk);
188 170
189 DCCP_INC_STATS_BH(DCCP_MIB_PASSIVEOPENS); 171 DCCP_INC_STATS_BH(DCCP_MIB_PASSIVEOPENS);