tcp_output.c (96916090f488986a4ebb8e9ffa6a3b50881d5ccd) | tcp_output.c (7d227cd235c809c36c847d6a597956ad9e9d2bae) |
---|---|
1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Version: $Id: tcp_output.c,v 1.146 2002/02/01 22:01:04 davem Exp $ --- 1822 unchanged lines hidden (view full) --- 1831/* This retransmits one SKB. Policy decisions and retransmit queue 1832 * state updates are done by the caller. Returns non-zero if an 1833 * error occurred which prevented the send. 1834 */ 1835int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) 1836{ 1837 struct tcp_sock *tp = tcp_sk(sk); 1838 struct inet_connection_sock *icsk = inet_csk(sk); | 1/* 2 * INET An implementation of the TCP/IP protocol suite for the LINUX 3 * operating system. INET is implemented using the BSD Socket 4 * interface as the means of communication with the user level. 5 * 6 * Implementation of the Transmission Control Protocol(TCP). 7 * 8 * Version: $Id: tcp_output.c,v 1.146 2002/02/01 22:01:04 davem Exp $ --- 1822 unchanged lines hidden (view full) --- 1831/* This retransmits one SKB. Policy decisions and retransmit queue 1832 * state updates are done by the caller. Returns non-zero if an 1833 * error occurred which prevented the send. 1834 */ 1835int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) 1836{ 1837 struct tcp_sock *tp = tcp_sk(sk); 1838 struct inet_connection_sock *icsk = inet_csk(sk); |
1839 unsigned int cur_mss = tcp_current_mss(sk, 0); | 1839 unsigned int cur_mss; |
1840 int err; 1841 1842 /* Inconslusive MTU probe */ 1843 if (icsk->icsk_mtup.probe_size) { 1844 icsk->icsk_mtup.probe_size = 0; 1845 } 1846 1847 /* Do not sent more than we queued. 1/4 is reserved for possible --- 5 unchanged lines hidden (view full) --- 1853 1854 if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { 1855 if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) 1856 BUG(); 1857 if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) 1858 return -ENOMEM; 1859 } 1860 | 1840 int err; 1841 1842 /* Inconslusive MTU probe */ 1843 if (icsk->icsk_mtup.probe_size) { 1844 icsk->icsk_mtup.probe_size = 0; 1845 } 1846 1847 /* Do not sent more than we queued. 1/4 is reserved for possible --- 5 unchanged lines hidden (view full) --- 1853 1854 if (before(TCP_SKB_CB(skb)->seq, tp->snd_una)) { 1855 if (before(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) 1856 BUG(); 1857 if (tcp_trim_head(sk, skb, tp->snd_una - TCP_SKB_CB(skb)->seq)) 1858 return -ENOMEM; 1859 } 1860 |
1861 if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) 1862 return -EHOSTUNREACH; /* Routing failure or similar. */ 1863 1864 cur_mss = tcp_current_mss(sk, 0); 1865 |
|
1861 /* If receiver has shrunk his window, and skb is out of 1862 * new window, do not retransmit it. The exception is the 1863 * case, when window is shrunk to zero. In this case 1864 * our retransmit serves as a zero window probe. 1865 */ 1866 if (!before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp)) 1867 && TCP_SKB_CB(skb)->seq != tp->snd_una) 1868 return -EAGAIN; --- 10 unchanged lines hidden (view full) --- 1879 (!tcp_skb_is_last(sk, skb)) && 1880 (skb_shinfo(skb)->nr_frags == 0 && 1881 skb_shinfo(tcp_write_queue_next(sk, skb))->nr_frags == 0) && 1882 (tcp_skb_pcount(skb) == 1 && 1883 tcp_skb_pcount(tcp_write_queue_next(sk, skb)) == 1) && 1884 (sysctl_tcp_retrans_collapse != 0)) 1885 tcp_retrans_try_collapse(sk, skb, cur_mss); 1886 | 1866 /* If receiver has shrunk his window, and skb is out of 1867 * new window, do not retransmit it. The exception is the 1868 * case, when window is shrunk to zero. In this case 1869 * our retransmit serves as a zero window probe. 1870 */ 1871 if (!before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp)) 1872 && TCP_SKB_CB(skb)->seq != tp->snd_una) 1873 return -EAGAIN; --- 10 unchanged lines hidden (view full) --- 1884 (!tcp_skb_is_last(sk, skb)) && 1885 (skb_shinfo(skb)->nr_frags == 0 && 1886 skb_shinfo(tcp_write_queue_next(sk, skb))->nr_frags == 0) && 1887 (tcp_skb_pcount(skb) == 1 && 1888 tcp_skb_pcount(tcp_write_queue_next(sk, skb)) == 1) && 1889 (sysctl_tcp_retrans_collapse != 0)) 1890 tcp_retrans_try_collapse(sk, skb, cur_mss); 1891 |
1887 if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) 1888 return -EHOSTUNREACH; /* Routing failure or similar. */ 1889 | |
1890 /* Some Solaris stacks overoptimize and ignore the FIN on a 1891 * retransmit when old data is attached. So strip it off 1892 * since it is cheap to do so and saves bytes on the network. 1893 */ 1894 if (skb->len > 0 && 1895 (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && 1896 tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) { 1897 if (!pskb_trim(skb, 0)) { --- 686 unchanged lines hidden --- | 1892 /* Some Solaris stacks overoptimize and ignore the FIN on a 1893 * retransmit when old data is attached. So strip it off 1894 * since it is cheap to do so and saves bytes on the network. 1895 */ 1896 if (skb->len > 0 && 1897 (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && 1898 tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) { 1899 if (!pskb_trim(skb, 0)) { --- 686 unchanged lines hidden --- |