aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-05-27 05:04:16 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:47:54 -0400
commitbdf1ee5d3bd38d0c44bd7baa74e07adcbe4ceab1 (patch)
treec14e3433624e03b7db6a9f30142581342e848ad6 /net/ipv4/tcp_output.c
parent539d243fdd7900fa5a544c7c154dc3ddf627e840 (diff)
[TCP]: Move code from tcp_ecn.h to tcp*.c and tcp.h & remove it
No other users exist for tcp_ecn.h. Very few things remain in tcp.h, for most TCP ECN functions callers reside within a single .c file and can be placed there. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index b11025e8a49e..3abe22e4b576 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -269,6 +269,56 @@ static u16 tcp_select_window(struct sock *sk)
269 return new_win; 269 return new_win;
270} 270}
271 271
272static inline void TCP_ECN_send_synack(struct tcp_sock *tp,
273 struct sk_buff *skb)
274{
275 TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_CWR;
276 if (!(tp->ecn_flags&TCP_ECN_OK))
277 TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE;
278}
279
280static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb)
281{
282 struct tcp_sock *tp = tcp_sk(sk);
283
284 tp->ecn_flags = 0;
285 if (sysctl_tcp_ecn) {
286 TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR;
287 tp->ecn_flags = TCP_ECN_OK;
288 }
289}
290
291static __inline__ void
292TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th)
293{
294 if (inet_rsk(req)->ecn_ok)
295 th->ece = 1;
296}
297
298static inline void TCP_ECN_send(struct sock *sk, struct sk_buff *skb,
299 int tcp_header_len)
300{
301 struct tcp_sock *tp = tcp_sk(sk);
302
303 if (tp->ecn_flags & TCP_ECN_OK) {
304 /* Not-retransmitted data segment: set ECT and inject CWR. */
305 if (skb->len != tcp_header_len &&
306 !before(TCP_SKB_CB(skb)->seq, tp->snd_nxt)) {
307 INET_ECN_xmit(sk);
308 if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) {
309 tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR;
310 tcp_hdr(skb)->cwr = 1;
311 skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
312 }
313 } else {
314 /* ACK or retransmitted segment: clear ECT|CE */
315 INET_ECN_dontxmit(sk);
316 }
317 if (tp->ecn_flags & TCP_ECN_DEMAND_CWR)
318 tcp_hdr(skb)->ece = 1;
319 }
320}
321
272static void tcp_build_and_update_options(__be32 *ptr, struct tcp_sock *tp, 322static void tcp_build_and_update_options(__be32 *ptr, struct tcp_sock *tp,
273 __u32 tstamp, __u8 **md5_hash) 323 __u32 tstamp, __u8 **md5_hash)
274{ 324{