diff options
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 7ed9dc1042d1..de3bd8458588 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -247,6 +247,7 @@ void tcp_select_initial_window(int __space, __u32 mss, | |||
| 247 | /* Set the clamp no higher than max representable value */ | 247 | /* Set the clamp no higher than max representable value */ |
| 248 | (*window_clamp) = min(65535U << (*rcv_wscale), *window_clamp); | 248 | (*window_clamp) = min(65535U << (*rcv_wscale), *window_clamp); |
| 249 | } | 249 | } |
| 250 | EXPORT_SYMBOL(tcp_select_initial_window); | ||
| 250 | 251 | ||
| 251 | /* Chose a new window to advertise, update state in tcp_sock for the | 252 | /* Chose a new window to advertise, update state in tcp_sock for the |
| 252 | * socket, and return result with RFC1323 scaling applied. The return | 253 | * socket, and return result with RFC1323 scaling applied. The return |
| @@ -294,9 +295,9 @@ static u16 tcp_select_window(struct sock *sk) | |||
| 294 | /* Packet ECN state for a SYN-ACK */ | 295 | /* Packet ECN state for a SYN-ACK */ |
| 295 | static inline void TCP_ECN_send_synack(struct tcp_sock *tp, struct sk_buff *skb) | 296 | static inline void TCP_ECN_send_synack(struct tcp_sock *tp, struct sk_buff *skb) |
| 296 | { | 297 | { |
| 297 | TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_CWR; | 298 | TCP_SKB_CB(skb)->flags &= ~TCPHDR_CWR; |
| 298 | if (!(tp->ecn_flags & TCP_ECN_OK)) | 299 | if (!(tp->ecn_flags & TCP_ECN_OK)) |
| 299 | TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE; | 300 | TCP_SKB_CB(skb)->flags &= ~TCPHDR_ECE; |
| 300 | } | 301 | } |
| 301 | 302 | ||
| 302 | /* Packet ECN state for a SYN. */ | 303 | /* Packet ECN state for a SYN. */ |
| @@ -306,7 +307,7 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb) | |||
| 306 | 307 | ||
| 307 | tp->ecn_flags = 0; | 308 | tp->ecn_flags = 0; |
| 308 | if (sysctl_tcp_ecn == 1) { | 309 | if (sysctl_tcp_ecn == 1) { |
| 309 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE | TCPCB_FLAG_CWR; | 310 | TCP_SKB_CB(skb)->flags |= TCPHDR_ECE | TCPHDR_CWR; |
| 310 | tp->ecn_flags = TCP_ECN_OK; | 311 | tp->ecn_flags = TCP_ECN_OK; |
| 311 | } | 312 | } |
| 312 | } | 313 | } |
| @@ -361,7 +362,7 @@ static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags) | |||
| 361 | skb_shinfo(skb)->gso_type = 0; | 362 | skb_shinfo(skb)->gso_type = 0; |
| 362 | 363 | ||
| 363 | TCP_SKB_CB(skb)->seq = seq; | 364 | TCP_SKB_CB(skb)->seq = seq; |
| 364 | if (flags & (TCPCB_FLAG_SYN | TCPCB_FLAG_FIN)) | 365 | if (flags & (TCPHDR_SYN | TCPHDR_FIN)) |
| 365 | seq++; | 366 | seq++; |
| 366 | TCP_SKB_CB(skb)->end_seq = seq; | 367 | TCP_SKB_CB(skb)->end_seq = seq; |
| 367 | } | 368 | } |
| @@ -820,7 +821,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
| 820 | tcb = TCP_SKB_CB(skb); | 821 | tcb = TCP_SKB_CB(skb); |
| 821 | memset(&opts, 0, sizeof(opts)); | 822 | memset(&opts, 0, sizeof(opts)); |
| 822 | 823 | ||
| 823 | if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) | 824 | if (unlikely(tcb->flags & TCPHDR_SYN)) |
| 824 | tcp_options_size = tcp_syn_options(sk, skb, &opts, &md5); | 825 | tcp_options_size = tcp_syn_options(sk, skb, &opts, &md5); |
| 825 | else | 826 | else |
| 826 | tcp_options_size = tcp_established_options(sk, skb, &opts, | 827 | tcp_options_size = tcp_established_options(sk, skb, &opts, |
| @@ -843,7 +844,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
| 843 | *(((__be16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | | 844 | *(((__be16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | |
| 844 | tcb->flags); | 845 | tcb->flags); |
| 845 | 846 | ||
| 846 | if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) { | 847 | if (unlikely(tcb->flags & TCPHDR_SYN)) { |
| 847 | /* RFC1323: The window in SYN & SYN/ACK segments | 848 | /* RFC1323: The window in SYN & SYN/ACK segments |
| 848 | * is never scaled. | 849 | * is never scaled. |
| 849 | */ | 850 | */ |
| @@ -866,7 +867,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
| 866 | } | 867 | } |
| 867 | 868 | ||
| 868 | tcp_options_write((__be32 *)(th + 1), tp, &opts); | 869 | tcp_options_write((__be32 *)(th + 1), tp, &opts); |
| 869 | if (likely((tcb->flags & TCPCB_FLAG_SYN) == 0)) | 870 | if (likely((tcb->flags & TCPHDR_SYN) == 0)) |
| 870 | TCP_ECN_send(sk, skb, tcp_header_size); | 871 | TCP_ECN_send(sk, skb, tcp_header_size); |
| 871 | 872 | ||
| 872 | #ifdef CONFIG_TCP_MD5SIG | 873 | #ifdef CONFIG_TCP_MD5SIG |
| @@ -880,7 +881,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
| 880 | 881 | ||
| 881 | icsk->icsk_af_ops->send_check(sk, skb); | 882 | icsk->icsk_af_ops->send_check(sk, skb); |
| 882 | 883 | ||
| 883 | if (likely(tcb->flags & TCPCB_FLAG_ACK)) | 884 | if (likely(tcb->flags & TCPHDR_ACK)) |
| 884 | tcp_event_ack_sent(sk, tcp_skb_pcount(skb)); | 885 | tcp_event_ack_sent(sk, tcp_skb_pcount(skb)); |
| 885 | 886 | ||
| 886 | if (skb->len != tcp_header_size) | 887 | if (skb->len != tcp_header_size) |
| @@ -1023,7 +1024,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, | |||
| 1023 | 1024 | ||
| 1024 | /* PSH and FIN should only be set in the second packet. */ | 1025 | /* PSH and FIN should only be set in the second packet. */ |
| 1025 | flags = TCP_SKB_CB(skb)->flags; | 1026 | flags = TCP_SKB_CB(skb)->flags; |
| 1026 | TCP_SKB_CB(skb)->flags = flags & ~(TCPCB_FLAG_FIN | TCPCB_FLAG_PSH); | 1027 | TCP_SKB_CB(skb)->flags = flags & ~(TCPHDR_FIN | TCPHDR_PSH); |
| 1027 | TCP_SKB_CB(buff)->flags = flags; | 1028 | TCP_SKB_CB(buff)->flags = flags; |
| 1028 | TCP_SKB_CB(buff)->sacked = TCP_SKB_CB(skb)->sacked; | 1029 | TCP_SKB_CB(buff)->sacked = TCP_SKB_CB(skb)->sacked; |
| 1029 | 1030 | ||
| @@ -1189,6 +1190,7 @@ void tcp_mtup_init(struct sock *sk) | |||
| 1189 | icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, sysctl_tcp_base_mss); | 1190 | icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, sysctl_tcp_base_mss); |
| 1190 | icsk->icsk_mtup.probe_size = 0; | 1191 | icsk->icsk_mtup.probe_size = 0; |
| 1191 | } | 1192 | } |
| 1193 | EXPORT_SYMBOL(tcp_mtup_init); | ||
| 1192 | 1194 | ||
| 1193 | /* This function synchronize snd mss to current pmtu/exthdr set. | 1195 | /* This function synchronize snd mss to current pmtu/exthdr set. |
| 1194 | 1196 | ||
| @@ -1232,6 +1234,7 @@ unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) | |||
| 1232 | 1234 | ||
| 1233 | return mss_now; | 1235 | return mss_now; |
| 1234 | } | 1236 | } |
| 1237 | EXPORT_SYMBOL(tcp_sync_mss); | ||
| 1235 | 1238 | ||
| 1236 | /* Compute the current effective MSS, taking SACKs and IP options, | 1239 | /* Compute the current effective MSS, taking SACKs and IP options, |
| 1237 | * and even PMTU discovery events into account. | 1240 | * and even PMTU discovery events into account. |
| @@ -1328,8 +1331,7 @@ static inline unsigned int tcp_cwnd_test(struct tcp_sock *tp, | |||
| 1328 | u32 in_flight, cwnd; | 1331 | u32 in_flight, cwnd; |
| 1329 | 1332 | ||
| 1330 | /* Don't be strict about the congestion window for the final FIN. */ | 1333 | /* Don't be strict about the congestion window for the final FIN. */ |
| 1331 | if ((TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && | 1334 | if ((TCP_SKB_CB(skb)->flags & TCPHDR_FIN) && tcp_skb_pcount(skb) == 1) |
| 1332 | tcp_skb_pcount(skb) == 1) | ||
| 1333 | return 1; | 1335 | return 1; |
| 1334 | 1336 | ||
| 1335 | in_flight = tcp_packets_in_flight(tp); | 1337 | in_flight = tcp_packets_in_flight(tp); |
| @@ -1398,7 +1400,7 @@ static inline int tcp_nagle_test(struct tcp_sock *tp, struct sk_buff *skb, | |||
| 1398 | * Nagle can be ignored during F-RTO too (see RFC4138). | 1400 | * Nagle can be ignored during F-RTO too (see RFC4138). |
| 1399 | */ | 1401 | */ |
| 1400 | if (tcp_urg_mode(tp) || (tp->frto_counter == 2) || | 1402 | if (tcp_urg_mode(tp) || (tp->frto_counter == 2) || |
| 1401 | (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)) | 1403 | (TCP_SKB_CB(skb)->flags & TCPHDR_FIN)) |
| 1402 | return 1; | 1404 | return 1; |
| 1403 | 1405 | ||
| 1404 | if (!tcp_nagle_check(tp, skb, cur_mss, nonagle)) | 1406 | if (!tcp_nagle_check(tp, skb, cur_mss, nonagle)) |
| @@ -1461,7 +1463,7 @@ int tcp_may_send_now(struct sock *sk) | |||
| 1461 | * packet has never been sent out before (and thus is not cloned). | 1463 | * packet has never been sent out before (and thus is not cloned). |
| 1462 | */ | 1464 | */ |
| 1463 | static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, | 1465 | static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, |
| 1464 | unsigned int mss_now) | 1466 | unsigned int mss_now, gfp_t gfp) |
| 1465 | { | 1467 | { |
| 1466 | struct sk_buff *buff; | 1468 | struct sk_buff *buff; |
| 1467 | int nlen = skb->len - len; | 1469 | int nlen = skb->len - len; |
| @@ -1471,7 +1473,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, | |||
| 1471 | if (skb->len != skb->data_len) | 1473 | if (skb->len != skb->data_len) |
| 1472 | return tcp_fragment(sk, skb, len, mss_now); | 1474 | return tcp_fragment(sk, skb, len, mss_now); |
| 1473 | 1475 | ||
| 1474 | buff = sk_stream_alloc_skb(sk, 0, GFP_ATOMIC); | 1476 | buff = sk_stream_alloc_skb(sk, 0, gfp); |
| 1475 | if (unlikely(buff == NULL)) | 1477 | if (unlikely(buff == NULL)) |
| 1476 | return -ENOMEM; | 1478 | return -ENOMEM; |
| 1477 | 1479 | ||
| @@ -1487,7 +1489,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, | |||
| 1487 | 1489 | ||
| 1488 | /* PSH and FIN should only be set in the second packet. */ | 1490 | /* PSH and FIN should only be set in the second packet. */ |
| 1489 | flags = TCP_SKB_CB(skb)->flags; | 1491 | flags = TCP_SKB_CB(skb)->flags; |
| 1490 | TCP_SKB_CB(skb)->flags = flags & ~(TCPCB_FLAG_FIN | TCPCB_FLAG_PSH); | 1492 | TCP_SKB_CB(skb)->flags = flags & ~(TCPHDR_FIN | TCPHDR_PSH); |
| 1491 | TCP_SKB_CB(buff)->flags = flags; | 1493 | TCP_SKB_CB(buff)->flags = flags; |
| 1492 | 1494 | ||
| 1493 | /* This packet was never sent out yet, so no SACK bits. */ | 1495 | /* This packet was never sent out yet, so no SACK bits. */ |
| @@ -1518,7 +1520,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
| 1518 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1520 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| 1519 | u32 send_win, cong_win, limit, in_flight; | 1521 | u32 send_win, cong_win, limit, in_flight; |
| 1520 | 1522 | ||
| 1521 | if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) | 1523 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) |
| 1522 | goto send_now; | 1524 | goto send_now; |
| 1523 | 1525 | ||
| 1524 | if (icsk->icsk_ca_state != TCP_CA_Open) | 1526 | if (icsk->icsk_ca_state != TCP_CA_Open) |
| @@ -1644,7 +1646,7 @@ static int tcp_mtu_probe(struct sock *sk) | |||
| 1644 | 1646 | ||
| 1645 | TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(skb)->seq; | 1647 | TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(skb)->seq; |
| 1646 | TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size; | 1648 | TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size; |
| 1647 | TCP_SKB_CB(nskb)->flags = TCPCB_FLAG_ACK; | 1649 | TCP_SKB_CB(nskb)->flags = TCPHDR_ACK; |
| 1648 | TCP_SKB_CB(nskb)->sacked = 0; | 1650 | TCP_SKB_CB(nskb)->sacked = 0; |
| 1649 | nskb->csum = 0; | 1651 | nskb->csum = 0; |
| 1650 | nskb->ip_summed = skb->ip_summed; | 1652 | nskb->ip_summed = skb->ip_summed; |
| @@ -1669,7 +1671,7 @@ static int tcp_mtu_probe(struct sock *sk) | |||
| 1669 | sk_wmem_free_skb(sk, skb); | 1671 | sk_wmem_free_skb(sk, skb); |
| 1670 | } else { | 1672 | } else { |
| 1671 | TCP_SKB_CB(nskb)->flags |= TCP_SKB_CB(skb)->flags & | 1673 | TCP_SKB_CB(nskb)->flags |= TCP_SKB_CB(skb)->flags & |
| 1672 | ~(TCPCB_FLAG_FIN|TCPCB_FLAG_PSH); | 1674 | ~(TCPHDR_FIN|TCPHDR_PSH); |
| 1673 | if (!skb_shinfo(skb)->nr_frags) { | 1675 | if (!skb_shinfo(skb)->nr_frags) { |
| 1674 | skb_pull(skb, copy); | 1676 | skb_pull(skb, copy); |
| 1675 | if (skb->ip_summed != CHECKSUM_PARTIAL) | 1677 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
| @@ -1769,7 +1771,7 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, | |||
| 1769 | cwnd_quota); | 1771 | cwnd_quota); |
| 1770 | 1772 | ||
| 1771 | if (skb->len > limit && | 1773 | if (skb->len > limit && |
| 1772 | unlikely(tso_fragment(sk, skb, limit, mss_now))) | 1774 | unlikely(tso_fragment(sk, skb, limit, mss_now, gfp))) |
| 1773 | break; | 1775 | break; |
| 1774 | 1776 | ||
| 1775 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 1777 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
| @@ -2020,7 +2022,7 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *to, | |||
| 2020 | 2022 | ||
| 2021 | if (!sysctl_tcp_retrans_collapse) | 2023 | if (!sysctl_tcp_retrans_collapse) |
| 2022 | return; | 2024 | return; |
| 2023 | if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_SYN) | 2025 | if (TCP_SKB_CB(skb)->flags & TCPHDR_SYN) |
| 2024 | return; | 2026 | return; |
| 2025 | 2027 | ||
| 2026 | tcp_for_write_queue_from_safe(skb, tmp, sk) { | 2028 | tcp_for_write_queue_from_safe(skb, tmp, sk) { |
| @@ -2112,7 +2114,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 2112 | * since it is cheap to do so and saves bytes on the network. | 2114 | * since it is cheap to do so and saves bytes on the network. |
| 2113 | */ | 2115 | */ |
| 2114 | if (skb->len > 0 && | 2116 | if (skb->len > 0 && |
| 2115 | (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && | 2117 | (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) && |
| 2116 | tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) { | 2118 | tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) { |
| 2117 | if (!pskb_trim(skb, 0)) { | 2119 | if (!pskb_trim(skb, 0)) { |
| 2118 | /* Reuse, even though it does some unnecessary work */ | 2120 | /* Reuse, even though it does some unnecessary work */ |
| @@ -2304,7 +2306,7 @@ void tcp_send_fin(struct sock *sk) | |||
| 2304 | mss_now = tcp_current_mss(sk); | 2306 | mss_now = tcp_current_mss(sk); |
| 2305 | 2307 | ||
| 2306 | if (tcp_send_head(sk) != NULL) { | 2308 | if (tcp_send_head(sk) != NULL) { |
| 2307 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_FIN; | 2309 | TCP_SKB_CB(skb)->flags |= TCPHDR_FIN; |
| 2308 | TCP_SKB_CB(skb)->end_seq++; | 2310 | TCP_SKB_CB(skb)->end_seq++; |
| 2309 | tp->write_seq++; | 2311 | tp->write_seq++; |
| 2310 | } else { | 2312 | } else { |
| @@ -2321,7 +2323,7 @@ void tcp_send_fin(struct sock *sk) | |||
| 2321 | skb_reserve(skb, MAX_TCP_HEADER); | 2323 | skb_reserve(skb, MAX_TCP_HEADER); |
| 2322 | /* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */ | 2324 | /* FIN eats a sequence byte, write_seq advanced by tcp_queue_skb(). */ |
| 2323 | tcp_init_nondata_skb(skb, tp->write_seq, | 2325 | tcp_init_nondata_skb(skb, tp->write_seq, |
| 2324 | TCPCB_FLAG_ACK | TCPCB_FLAG_FIN); | 2326 | TCPHDR_ACK | TCPHDR_FIN); |
| 2325 | tcp_queue_skb(sk, skb); | 2327 | tcp_queue_skb(sk, skb); |
| 2326 | } | 2328 | } |
| 2327 | __tcp_push_pending_frames(sk, mss_now, TCP_NAGLE_OFF); | 2329 | __tcp_push_pending_frames(sk, mss_now, TCP_NAGLE_OFF); |
| @@ -2346,7 +2348,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority) | |||
| 2346 | /* Reserve space for headers and prepare control bits. */ | 2348 | /* Reserve space for headers and prepare control bits. */ |
| 2347 | skb_reserve(skb, MAX_TCP_HEADER); | 2349 | skb_reserve(skb, MAX_TCP_HEADER); |
| 2348 | tcp_init_nondata_skb(skb, tcp_acceptable_seq(sk), | 2350 | tcp_init_nondata_skb(skb, tcp_acceptable_seq(sk), |
| 2349 | TCPCB_FLAG_ACK | TCPCB_FLAG_RST); | 2351 | TCPHDR_ACK | TCPHDR_RST); |
| 2350 | /* Send it off. */ | 2352 | /* Send it off. */ |
| 2351 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 2353 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
| 2352 | if (tcp_transmit_skb(sk, skb, 0, priority)) | 2354 | if (tcp_transmit_skb(sk, skb, 0, priority)) |
| @@ -2366,11 +2368,11 @@ int tcp_send_synack(struct sock *sk) | |||
| 2366 | struct sk_buff *skb; | 2368 | struct sk_buff *skb; |
| 2367 | 2369 | ||
| 2368 | skb = tcp_write_queue_head(sk); | 2370 | skb = tcp_write_queue_head(sk); |
| 2369 | if (skb == NULL || !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_SYN)) { | 2371 | if (skb == NULL || !(TCP_SKB_CB(skb)->flags & TCPHDR_SYN)) { |
| 2370 | printk(KERN_DEBUG "tcp_send_synack: wrong queue state\n"); | 2372 | printk(KERN_DEBUG "tcp_send_synack: wrong queue state\n"); |
| 2371 | return -EFAULT; | 2373 | return -EFAULT; |
| 2372 | } | 2374 | } |
| 2373 | if (!(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_ACK)) { | 2375 | if (!(TCP_SKB_CB(skb)->flags & TCPHDR_ACK)) { |
| 2374 | if (skb_cloned(skb)) { | 2376 | if (skb_cloned(skb)) { |
| 2375 | struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); | 2377 | struct sk_buff *nskb = skb_copy(skb, GFP_ATOMIC); |
| 2376 | if (nskb == NULL) | 2378 | if (nskb == NULL) |
| @@ -2384,7 +2386,7 @@ int tcp_send_synack(struct sock *sk) | |||
| 2384 | skb = nskb; | 2386 | skb = nskb; |
| 2385 | } | 2387 | } |
| 2386 | 2388 | ||
| 2387 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ACK; | 2389 | TCP_SKB_CB(skb)->flags |= TCPHDR_ACK; |
| 2388 | TCP_ECN_send_synack(tcp_sk(sk), skb); | 2390 | TCP_ECN_send_synack(tcp_sk(sk), skb); |
| 2389 | } | 2391 | } |
| 2390 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 2392 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
| @@ -2463,7 +2465,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
| 2463 | * not even correctly set) | 2465 | * not even correctly set) |
| 2464 | */ | 2466 | */ |
| 2465 | tcp_init_nondata_skb(skb, tcp_rsk(req)->snt_isn, | 2467 | tcp_init_nondata_skb(skb, tcp_rsk(req)->snt_isn, |
| 2466 | TCPCB_FLAG_SYN | TCPCB_FLAG_ACK); | 2468 | TCPHDR_SYN | TCPHDR_ACK); |
| 2467 | 2469 | ||
| 2468 | if (OPTION_COOKIE_EXTENSION & opts.options) { | 2470 | if (OPTION_COOKIE_EXTENSION & opts.options) { |
| 2469 | if (s_data_desired) { | 2471 | if (s_data_desired) { |
| @@ -2518,6 +2520,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
| 2518 | 2520 | ||
| 2519 | return skb; | 2521 | return skb; |
| 2520 | } | 2522 | } |
| 2523 | EXPORT_SYMBOL(tcp_make_synack); | ||
| 2521 | 2524 | ||
| 2522 | /* Do all connect socket setups that can be done AF independent. */ | 2525 | /* Do all connect socket setups that can be done AF independent. */ |
| 2523 | static void tcp_connect_init(struct sock *sk) | 2526 | static void tcp_connect_init(struct sock *sk) |
| @@ -2595,7 +2598,7 @@ int tcp_connect(struct sock *sk) | |||
| 2595 | skb_reserve(buff, MAX_TCP_HEADER); | 2598 | skb_reserve(buff, MAX_TCP_HEADER); |
| 2596 | 2599 | ||
| 2597 | tp->snd_nxt = tp->write_seq; | 2600 | tp->snd_nxt = tp->write_seq; |
| 2598 | tcp_init_nondata_skb(buff, tp->write_seq++, TCPCB_FLAG_SYN); | 2601 | tcp_init_nondata_skb(buff, tp->write_seq++, TCPHDR_SYN); |
| 2599 | TCP_ECN_send_syn(sk, buff); | 2602 | TCP_ECN_send_syn(sk, buff); |
| 2600 | 2603 | ||
| 2601 | /* Send it off. */ | 2604 | /* Send it off. */ |
| @@ -2620,6 +2623,7 @@ int tcp_connect(struct sock *sk) | |||
| 2620 | inet_csk(sk)->icsk_rto, TCP_RTO_MAX); | 2623 | inet_csk(sk)->icsk_rto, TCP_RTO_MAX); |
| 2621 | return 0; | 2624 | return 0; |
| 2622 | } | 2625 | } |
| 2626 | EXPORT_SYMBOL(tcp_connect); | ||
| 2623 | 2627 | ||
| 2624 | /* Send out a delayed ack, the caller does the policy checking | 2628 | /* Send out a delayed ack, the caller does the policy checking |
| 2625 | * to see if we should even be here. See tcp_input.c:tcp_ack_snd_check() | 2629 | * to see if we should even be here. See tcp_input.c:tcp_ack_snd_check() |
| @@ -2701,7 +2705,7 @@ void tcp_send_ack(struct sock *sk) | |||
| 2701 | 2705 | ||
| 2702 | /* Reserve space for headers and prepare control bits. */ | 2706 | /* Reserve space for headers and prepare control bits. */ |
| 2703 | skb_reserve(buff, MAX_TCP_HEADER); | 2707 | skb_reserve(buff, MAX_TCP_HEADER); |
| 2704 | tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPCB_FLAG_ACK); | 2708 | tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK); |
| 2705 | 2709 | ||
| 2706 | /* Send it off, this clears delayed acks for us. */ | 2710 | /* Send it off, this clears delayed acks for us. */ |
| 2707 | TCP_SKB_CB(buff)->when = tcp_time_stamp; | 2711 | TCP_SKB_CB(buff)->when = tcp_time_stamp; |
| @@ -2735,7 +2739,7 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent) | |||
| 2735 | * end to send an ack. Don't queue or clone SKB, just | 2739 | * end to send an ack. Don't queue or clone SKB, just |
| 2736 | * send it. | 2740 | * send it. |
| 2737 | */ | 2741 | */ |
| 2738 | tcp_init_nondata_skb(skb, tp->snd_una - !urgent, TCPCB_FLAG_ACK); | 2742 | tcp_init_nondata_skb(skb, tp->snd_una - !urgent, TCPHDR_ACK); |
| 2739 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 2743 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
| 2740 | return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC); | 2744 | return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC); |
| 2741 | } | 2745 | } |
| @@ -2765,13 +2769,13 @@ int tcp_write_wakeup(struct sock *sk) | |||
| 2765 | if (seg_size < TCP_SKB_CB(skb)->end_seq - TCP_SKB_CB(skb)->seq || | 2769 | if (seg_size < TCP_SKB_CB(skb)->end_seq - TCP_SKB_CB(skb)->seq || |
| 2766 | skb->len > mss) { | 2770 | skb->len > mss) { |
| 2767 | seg_size = min(seg_size, mss); | 2771 | seg_size = min(seg_size, mss); |
| 2768 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; | 2772 | TCP_SKB_CB(skb)->flags |= TCPHDR_PSH; |
| 2769 | if (tcp_fragment(sk, skb, seg_size, mss)) | 2773 | if (tcp_fragment(sk, skb, seg_size, mss)) |
| 2770 | return -1; | 2774 | return -1; |
| 2771 | } else if (!tcp_skb_pcount(skb)) | 2775 | } else if (!tcp_skb_pcount(skb)) |
| 2772 | tcp_set_skb_tso_segs(sk, skb, mss); | 2776 | tcp_set_skb_tso_segs(sk, skb, mss); |
| 2773 | 2777 | ||
| 2774 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; | 2778 | TCP_SKB_CB(skb)->flags |= TCPHDR_PSH; |
| 2775 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 2779 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
| 2776 | err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); | 2780 | err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC); |
| 2777 | if (!err) | 2781 | if (!err) |
| @@ -2824,10 +2828,3 @@ void tcp_send_probe0(struct sock *sk) | |||
| 2824 | TCP_RTO_MAX); | 2828 | TCP_RTO_MAX); |
| 2825 | } | 2829 | } |
| 2826 | } | 2830 | } |
| 2827 | |||
| 2828 | EXPORT_SYMBOL(tcp_select_initial_window); | ||
| 2829 | EXPORT_SYMBOL(tcp_connect); | ||
| 2830 | EXPORT_SYMBOL(tcp_make_synack); | ||
| 2831 | EXPORT_SYMBOL(tcp_simple_retransmit); | ||
| 2832 | EXPORT_SYMBOL(tcp_sync_mss); | ||
| 2833 | EXPORT_SYMBOL(tcp_mtup_init); | ||
