diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-08-09 23:30:56 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:55:18 -0400 |
commit | 27258ee54f8cd4a43d09319aa5448145afc2cb8d (patch) | |
tree | 4a52d16da47f7ab0777252169406ae85e53488b1 /net/dccp/output.c | |
parent | 0d48d93947dd9ea21c5cdc76a8581b06a4a39281 (diff) |
[DCCP]: Introduce dccp_write_xmit from code in dccp_sendmsg
This way it gets closer to the TCP flow, where congestion window
checks are done, it seems we can map ccid_hc_tx_send_packet in
dccp_write_xmit to tcp_snd_wnd_test in tcp_write_xmit, a CCID2
decision should just fit in here as well...
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r-- | net/dccp/output.c | 38 |
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 | ||
151 | int 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 | |||
151 | int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | 186 | int 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 | ||