tcp_input.c (102412) | tcp_input.c (103505) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 |
34 * $FreeBSD: head/sys/netinet/tcp_input.c 102412 2002-08-25 13:23:09Z charnier $ | 34 * $FreeBSD: head/sys/netinet/tcp_input.c 103505 2002-09-17 22:21:37Z dillon $ |
35 */ 36 37#include "opt_ipfw.h" /* for ipfw_fwd */ 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_tcpdebug.h" 42#include "opt_tcp_input.h" --- 940 unchanged lines hidden (view full) --- 983 if (tp->t_rxtshift == 1 && 984 ticks < tp->t_badrxtwin) { 985 tp->snd_cwnd = tp->snd_cwnd_prev; 986 tp->snd_ssthresh = 987 tp->snd_ssthresh_prev; 988 tp->snd_nxt = tp->snd_max; 989 tp->t_badrxtwin = 0; 990 } | 35 */ 36 37#include "opt_ipfw.h" /* for ipfw_fwd */ 38#include "opt_inet6.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_tcpdebug.h" 42#include "opt_tcp_input.h" --- 940 unchanged lines hidden (view full) --- 983 if (tp->t_rxtshift == 1 && 984 ticks < tp->t_badrxtwin) { 985 tp->snd_cwnd = tp->snd_cwnd_prev; 986 tp->snd_ssthresh = 987 tp->snd_ssthresh_prev; 988 tp->snd_nxt = tp->snd_max; 989 tp->t_badrxtwin = 0; 990 } |
991 if ((to.to_flags & TOF_TS) != 0) | 991 992 /* 993 * Recalculate the transmit timer / rtt. 994 * 995 * Some boxes send broken timestamp replies 996 * during the SYN+ACK phase, ignore 997 * timestamps of 0 or we could calculate a 998 * huge RTT and blow up the retransmit timer. 999 */ 1000 if ((to.to_flags & TOF_TS) != 0 && 1001 to.to_tsecr) { |
992 tcp_xmit_timer(tp, 993 ticks - to.to_tsecr + 1); | 1002 tcp_xmit_timer(tp, 1003 ticks - to.to_tsecr + 1); |
994 else if (tp->t_rtttime && 995 SEQ_GT(th->th_ack, tp->t_rtseq)) | 1004 } else if (tp->t_rtttime && 1005 SEQ_GT(th->th_ack, tp->t_rtseq)) { |
996 tcp_xmit_timer(tp, 997 ticks - tp->t_rtttime); | 1006 tcp_xmit_timer(tp, 1007 ticks - tp->t_rtttime); |
1008 } |
|
998 tcp_xmit_bandwidth_limit(tp, th->th_ack); 999 acked = th->th_ack - tp->snd_una; 1000 tcpstat.tcps_rcvackpack++; 1001 tcpstat.tcps_rcvackbyte += acked; 1002 sbdrop(&so->so_snd, acked); 1003 tp->snd_una = th->th_ack; 1004 tp->t_dupacks = 0; 1005 m_freem(m); --- 799 unchanged lines hidden (view full) --- 1805 /* 1806 * If we have a timestamp reply, update smoothed 1807 * round trip time. If no timestamp is present but 1808 * transmit timer is running and timed sequence 1809 * number was acked, update smoothed round trip time. 1810 * Since we now have an rtt measurement, cancel the 1811 * timer backoff (cf., Phil Karn's retransmit alg.). 1812 * Recompute the initial retransmit timer. | 1009 tcp_xmit_bandwidth_limit(tp, th->th_ack); 1010 acked = th->th_ack - tp->snd_una; 1011 tcpstat.tcps_rcvackpack++; 1012 tcpstat.tcps_rcvackbyte += acked; 1013 sbdrop(&so->so_snd, acked); 1014 tp->snd_una = th->th_ack; 1015 tp->t_dupacks = 0; 1016 m_freem(m); --- 799 unchanged lines hidden (view full) --- 1816 /* 1817 * If we have a timestamp reply, update smoothed 1818 * round trip time. If no timestamp is present but 1819 * transmit timer is running and timed sequence 1820 * number was acked, update smoothed round trip time. 1821 * Since we now have an rtt measurement, cancel the 1822 * timer backoff (cf., Phil Karn's retransmit alg.). 1823 * Recompute the initial retransmit timer. |
1824 * 1825 * Some boxes send broken timestamp replies 1826 * during the SYN+ACK phase, ignore 1827 * timestamps of 0 or we could calculate a 1828 * huge RTT and blow up the retransmit timer. |
|
1813 */ | 1829 */ |
1814 if (to.to_flags & TOF_TS) | 1830 if ((to.to_flags & TOF_TS) != 0 && 1831 to.to_tsecr) { |
1815 tcp_xmit_timer(tp, ticks - to.to_tsecr + 1); | 1832 tcp_xmit_timer(tp, ticks - to.to_tsecr + 1); |
1816 else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq)) | 1833 } else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq)) { |
1817 tcp_xmit_timer(tp, ticks - tp->t_rtttime); | 1834 tcp_xmit_timer(tp, ticks - tp->t_rtttime); |
1835 } |
|
1818 tcp_xmit_bandwidth_limit(tp, th->th_ack); 1819 1820 /* 1821 * If all outstanding data is acked, stop retransmit 1822 * timer and remember to restart (more output or persist). 1823 * If there is more data to be acked, restart retransmit 1824 * timer, using current (possibly backed-off) value. 1825 */ --- 939 unchanged lines hidden --- | 1836 tcp_xmit_bandwidth_limit(tp, th->th_ack); 1837 1838 /* 1839 * If all outstanding data is acked, stop retransmit 1840 * timer and remember to restart (more output or persist). 1841 * If there is more data to be acked, restart retransmit 1842 * timer, using current (possibly backed-off) value. 1843 */ --- 939 unchanged lines hidden --- |