aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r--net/dccp/output.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index 4945eaa9d1a4..50292c0605fb 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -148,6 +148,41 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
148 return mss_now; 148 return mss_now;
149} 149}
150 150
151int dccp_write_xmit(struct sock *sk, struct sk_buff *skb, const int len)
152{
153 const struct dccp_sock *dp = dccp_sk(sk);
154 int err = ccid_hc_tx_send_packet(dp->dccps_hc_tx_ccid, sk, skb, len);
155
156 if (err == 0) {
157 const struct dccp_ackpkts *ap = dp->dccps_hc_rx_ackpkts;
158 struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb);
159
160 if (sk->sk_state == DCCP_PARTOPEN) {
161 /* See 8.1.5. Handshake Completion */
162 inet_csk_schedule_ack(sk);
163 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
164 inet_csk(sk)->icsk_rto,
165 DCCP_RTO_MAX);
166 dcb->dccpd_type = DCCP_PKT_DATAACK;
167 /*
168 * FIXME: we really should have a
169 * dccps_ack_pending or use icsk.
170 */
171 } else if (inet_csk_ack_scheduled(sk) ||
172 (dp->dccps_options.dccpo_send_ack_vector &&
173 ap->dccpap_buf_ackno != DCCP_MAX_SEQNO + 1 &&
174 ap->dccpap_ack_seqno == DCCP_MAX_SEQNO + 1))
175 dcb->dccpd_type = DCCP_PKT_DATAACK;
176 else
177 dcb->dccpd_type = DCCP_PKT_DATA;
178
179 err = dccp_transmit_skb(sk, skb);
180 ccid_hc_tx_packet_sent(dp->dccps_hc_tx_ccid, sk, 0, len);
181 }
182
183 return err;
184}
185
151int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb) 186int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
152{ 187{
153 if (inet_sk_rebuild_header(sk) != 0) 188 if (inet_sk_rebuild_header(sk) != 0)
@@ -299,7 +334,8 @@ int dccp_connect(struct sock *sk)
299 DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS); 334 DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS);
300 335
301 /* Timer for repeating the REQUEST until an answer. */ 336 /* Timer for repeating the REQUEST until an answer. */
302 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, TCP_RTO_MAX); 337 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
338 icsk->icsk_rto, DCCP_RTO_MAX);
303 return 0; 339 return 0;
304} 340}
305 341