diff options
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 238 |
1 files changed, 119 insertions, 119 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index a307b6ac266..5b1e2bb9e33 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.116 2002/06/07 16:18:02 itojun Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.117 2002/06/09 16:26:11 itojun Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -34,11 +34,11 @@ * SUCH DAMAGE. * * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 - * + * * NRL grants permission for redistribution and use in source and binary * forms, with or without modification, of the software and documentation * created at NRL provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright @@ -53,7 +53,7 @@ * 4. Neither the name of the NRL nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THE SOFTWARE PROVIDED BY NRL IS PROVIDED BY NRL AND CONTRIBUTORS ``AS * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -65,7 +65,7 @@ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation * are those of the authors and should not be interpreted as representing * official policies, either expressed or implied, of the US Naval @@ -444,7 +444,7 @@ tcp_input(struct mbuf *m, ...) /* * Before we do ANYTHING, we have to figure out if it's TCP/IPv6 or * TCP/IPv4. - */ + */ switch (mtod(m, struct ip *)->ip_v) { #ifdef INET6 case 6: @@ -629,7 +629,7 @@ tcp_input(struct mbuf *m, ...) } optlen = off - sizeof(struct tcphdr); optp = mtod(m, caddr_t) + iphlen + sizeof(struct tcphdr); - /* + /* * Do quick retrieval of timestamp options ("options * prediction?"). If timestamp is the only option and it's * formatted as recommended in RFC 1323 appendix A, we @@ -705,7 +705,7 @@ findpcb: goto dropwithreset_ratelim; if (tp->t_state == TCPS_CLOSED) goto drop; - + /* Unscale the window into a 32-bit value. */ if ((tiflags & TH_SYN) == 0) tiwin = th->th_win << tp->snd_scale; @@ -751,7 +751,7 @@ findpcb: */ dropsocket++; #ifdef IPSEC - /* + /* * We need to copy the required security levels * from the old pcb. Ditto for any other * IPsec-related information. @@ -783,19 +783,19 @@ findpcb: * done particularly for the case where an AF_INET6 * socket is bound only to a port, and a v4 connection * comes in on that port. - * we also copy the flowinfo from the original pcb + * we also copy the flowinfo from the original pcb * to the new one. */ { int flags = inp->inp_flags; struct inpcb *oldinpcb = inp; - + inp = (struct inpcb *)so->so_pcb; inp->inp_flags |= (flags & INP_IPV6); if ((inp->inp_flags & INP_IPV6) != 0) { - inp->inp_ipv6.ip6_hlim = + inp->inp_ipv6.ip6_hlim = oldinpcb->inp_ipv6.ip6_hlim; - inp->inp_ipv6.ip6_flow = + inp->inp_ipv6.ip6_flow = oldinpcb->inp_ipv6.ip6_flow; } } @@ -807,7 +807,7 @@ findpcb: #ifdef INET6 case AF_INET6: inp->inp_laddr6 = ipv6->ip6_dst; - + /*inp->inp_options = ip6_srcroute();*/ /* soon. */ /* * still need to tweak outbound options @@ -920,7 +920,7 @@ findpcb: tcpstat.tcps_ecn_rcvce++; } #endif - /* + /* * Header prediction: check for the two common cases * of a uni-directional data xfer. If the packet has * no control flags, is in-sequence, the window didn't @@ -945,7 +945,7 @@ findpcb: tiwin && tiwin == tp->snd_wnd && tp->snd_nxt == tp->snd_max) { - /* + /* * If last ACK falls within this segment's sequence numbers, * record the timestamp. * Fix from Braden, see Stevens p. 870 @@ -977,7 +977,7 @@ findpcb: sbdrop(&so->so_snd, acked); tp->snd_una = th->th_ack; #if defined(TCP_SACK) || defined(TCP_ECN) - /* + /* * We want snd_last to track snd_una so * as to avoid sequence wraparound problems * for very large transfers. @@ -1201,11 +1201,11 @@ findpcb: #ifdef TCP_SACK /* * If peer did not send a SACK_PERMITTED option (i.e., if - * tcp_dooptions() did not set TF_SACK_PERMIT), set + * tcp_dooptions() did not set TF_SACK_PERMIT), set * sack_disable to 1 if it is currently 0. */ if (!tp->sack_disable) - if ((tp->t_flags & TF_SACK_PERMIT) == 0) + if ((tp->t_flags & TF_SACK_PERMIT) == 0) tp->sack_disable = 1; #endif @@ -1252,7 +1252,7 @@ findpcb: * If the state is SYN_RECEIVED: * if seg contains SYN/ACK, send an RST. * if seg contains an ACK, but not for our SYN/ACK, send an RST - */ + */ case TCPS_SYN_RECEIVED: if (tiflags & TH_ACK) { @@ -1311,7 +1311,7 @@ findpcb: * been set in tcp_dooptions(). If it was not, disable SACKs. */ if (!tp->sack_disable) - if ((tp->t_flags & TF_SACK_PERMIT) == 0) + if ((tp->t_flags & TF_SACK_PERMIT) == 0) tp->sack_disable = 1; #endif #ifdef TCP_ECN @@ -1385,10 +1385,10 @@ trimthenstep6: /* * States other than LISTEN or SYN_SENT. * First check timestamp, if present. - * Then check that at least some bytes of segment are within + * Then check that at least some bytes of segment are within * receive window. If segment begins before rcv_nxt, * drop leading data (and SYN); if nothing left, just ack. - * + * * RFC 1323 PAWS: If we have a timestamp reply on this segment * and it's less than ts_recent, drop it. */ @@ -1422,7 +1422,7 @@ trimthenstep6: if (tiflags & TH_SYN) { tiflags &= ~TH_SYN; th->th_seq++; - if (th->th_urp > 1) + if (th->th_urp > 1) th->th_urp--; else tiflags &= ~TH_URG; @@ -1581,7 +1581,7 @@ trimthenstep6: else goto drop; } - + /* * Ack processing. */ @@ -1701,7 +1701,7 @@ trimthenstep6: * the new ssthresh). * * Dup acks mean that packets have left the - * network (they're now cached at the receiver) + * network (they're now cached at the receiver) * so bump cwnd by the amount in the receiver * to keep a constant cwnd packets in the * network. @@ -1709,12 +1709,12 @@ trimthenstep6: if (TCP_TIMER_ISARMED(tp, TCPT_REXMT) == 0) tp->t_dupacks = 0; #if defined(TCP_SACK) && defined(TCP_FACK) - /* + /* * In FACK, can enter fast rec. if the receiver * reports a reass. queue longer than 3 segs. */ else if (++tp->t_dupacks == tcprexmtthresh || - ((SEQ_GT(tp->snd_fack, tcprexmtthresh * + ((SEQ_GT(tp->snd_fack, tcprexmtthresh * tp->t_maxseg + tp->snd_una)) && SEQ_GT(tp->snd_una, tp->snd_last))) { #else @@ -1727,8 +1727,8 @@ trimthenstep6: #if defined(TCP_SACK) || defined(TCP_ECN) if (SEQ_LT(th->th_ack, tp->snd_last)){ - /* - * False fast retx after + /* + * False fast retx after * timeout. Do not cut window. */ tp->t_dupacks = 0; @@ -1752,7 +1752,7 @@ trimthenstep6: tcpstat.tcps_cwr_frecovery++; #endif tcpstat.tcps_sndrexmitfast++; -#if defined(TCP_SACK) && defined(TCP_FACK) +#if defined(TCP_SACK) && defined(TCP_FACK) tp->t_dupacks = tcprexmtthresh; (void) tcp_output(tp); /* @@ -1761,7 +1761,7 @@ trimthenstep6: */ tp->snd_cwnd = tp->snd_ssthresh; #else - /* + /* * tcp_output() will send * oldest SACK-eligible rtx. */ @@ -1792,9 +1792,9 @@ trimthenstep6: goto drop; } else if (tp->t_dupacks > tcprexmtthresh) { #if defined(TCP_SACK) && defined(TCP_FACK) - /* - * while (awnd < cwnd) - * sendsomething(); + /* + * while (awnd < cwnd) + * sendsomething(); */ if (!tp->sack_disable) { if (tp->snd_awnd < tp->snd_cwnd) @@ -1828,7 +1828,7 @@ trimthenstep6: if (tcp_sack_partialack(tp, th)) { #if defined(TCP_SACK) && defined(TCP_FACK) /* Force call to tcp_output */ - if (tp->snd_awnd < tp->snd_cwnd) + if (tp->snd_awnd < tp->snd_cwnd) needoutput = 1; #else tp->snd_cwnd += tp->t_maxseg; @@ -1837,9 +1837,9 @@ trimthenstep6: } else { /* Out of fast recovery */ tp->snd_cwnd = tp->snd_ssthresh; - if (tcp_seq_subtract(tp->snd_max, + if (tcp_seq_subtract(tp->snd_max, th->th_ack) < tp->snd_ssthresh) - tp->snd_cwnd = + tp->snd_cwnd = tcp_seq_subtract(tp->snd_max, th->th_ack); tp->t_dupacks = 0; @@ -1848,15 +1848,15 @@ trimthenstep6: tp->snd_fack = th->th_ack; #endif /* TCP_FACK */ } - } + } } else { - if (tp->t_dupacks >= tcprexmtthresh && + if (tp->t_dupacks >= tcprexmtthresh && !tcp_newreno(tp, th)) { /* Out of fast recovery */ tp->snd_cwnd = tp->snd_ssthresh; if (tcp_seq_subtract(tp->snd_max, th->th_ack) < tp->snd_ssthresh) - tp->snd_cwnd = + tp->snd_cwnd = tcp_seq_subtract(tp->snd_max, th->th_ack); tp->t_dupacks = 0; @@ -2055,14 +2055,14 @@ step6: * If this segment advances the known urgent pointer, * then mark the data stream. This should not happen * in CLOSE_WAIT, CLOSING, LAST_ACK or TIME_WAIT STATES since - * a FIN has been received from the remote side. + * a FIN has been received from the remote side. * In these states we ignore the URG. * * According to RFC961 (Assigned Protocols), * the urgent pointer points to the last octet * of urgent data. We continue, however, * to consider it to indicate the first octet - * of data past the urgent section as the original + * of data past the urgent section as the original * spec states (in one of two places). */ if (SEQ_GT(th->th_seq+th->th_urp, tp->rcv_up)) { @@ -2124,10 +2124,10 @@ dodata: /* XXX */ } #ifdef TCP_SACK if (!tp->sack_disable) - tcp_update_sack_list(tp); -#endif + tcp_update_sack_list(tp); +#endif - /* + /* * variable len never referenced again in modern BSD, * so why bother computing it ?? */ @@ -2174,7 +2174,7 @@ dodata: /* XXX */ /* * In FIN_WAIT_2 state enter the TIME_WAIT state, - * starting the time-wait timer, turning off the other + * starting the time-wait timer, turning off the other * standard timers. */ case TCPS_FIN_WAIT_2: @@ -2360,7 +2360,7 @@ tcp_dooptions(tp, cp, cnt, th, ts_present, ts_val, ts_ecr) bcopy((char *)cp + 6, (char *) ts_ecr, sizeof(*ts_ecr)); NTOHL(*ts_ecr); - /* + /* * A timestamp received in a SYN makes * it ok to send timestamp requests and replies. */ @@ -2370,8 +2370,8 @@ tcp_dooptions(tp, cp, cnt, th, ts_present, ts_val, ts_ecr) tp->ts_recent_age = tcp_now; } break; - -#ifdef TCP_SACK + +#ifdef TCP_SACK case TCPOPT_SACK_PERMITTED: if (tp->sack_disable || optlen!=TCPOLEN_SACK_PERMITTED) continue; @@ -2383,7 +2383,7 @@ tcp_dooptions(tp, cp, cnt, th, ts_present, ts_val, ts_ecr) if (tcp_sack_option(tp, th, cp, optlen)) continue; break; -#endif +#endif } } /* Update t_maxopd and t_maxseg after all options are processed */ @@ -2396,33 +2396,33 @@ tcp_dooptions(tp, cp, cnt, th, ts_present, ts_val, ts_ecr) } #if defined(TCP_SACK) -u_long +u_long tcp_seq_subtract(a, b) u_long a, b; -{ - return ((long)(a - b)); +{ + return ((long)(a - b)); } #endif -#ifdef TCP_SACK +#ifdef TCP_SACK /* * This function is called upon receipt of new valid data (while not in header - * prediction mode), and it updates the ordered list of sacks. + * prediction mode), and it updates the ordered list of sacks. */ -void +void tcp_update_sack_list(tp) - struct tcpcb *tp; -{ - /* + struct tcpcb *tp; +{ + /* * First reported block MUST be the most recent one. Subsequent * blocks SHOULD be in the order in which they arrived at the * receiver. These two conditions make the implementation fully * compliant with RFC 2018. - */ + */ int i, j = 0, count = 0, lastpos = -1; struct sackblk sack, firstsack, temp[MAX_SACK_BLKS]; - + /* First clean up current list of sacks */ for (i = 0; i < tp->rcv_numsacks; i++) { sack = tp->sackblks[i]; @@ -2433,11 +2433,11 @@ tcp_update_sack_list(tp) if (SEQ_LEQ(sack.end, tp->rcv_nxt)) { tp->sackblks[i].start = tp->sackblks[i].end = 0; count++; - } else { + } else { temp[j].start = tp->sackblks[i].start; temp[j++].end = tp->sackblks[i].end; } - } + } tp->rcv_numsacks -= count; if (tp->rcv_numsacks == 0) { /* no sack blocks currently (fast path) */ tcp_clean_sackreport(tp); @@ -2452,9 +2452,9 @@ tcp_update_sack_list(tp) /* Otherwise, sack blocks are already present. */ for (i = 0; i < tp->rcv_numsacks; i++) tp->sackblks[i] = temp[i]; /* first copy back sack list */ - if (SEQ_GEQ(tp->rcv_nxt, tp->rcv_lastend)) + if (SEQ_GEQ(tp->rcv_nxt, tp->rcv_lastend)) return; /* sack list remains unchanged */ - /* + /* * From here, segment just received should be (part of) the 1st sack. * Go through list, possibly coalescing sack block entries. */ @@ -2466,7 +2466,7 @@ tcp_update_sack_list(tp) SEQ_GT(sack.start, firstsack.end)) continue; /* no overlap */ if (sack.start == firstsack.start && sack.end == firstsack.end){ - /* + /* * identical block; delete it here since we will * move it to the front of the list. */ @@ -2499,23 +2499,23 @@ tcp_update_sack_list(tp) } tp->sackblks[0] = firstsack; return; -} +} /* * Process the TCP SACK option. Returns 1 if tcp_dooptions() should continue, * and 0 otherwise, if the option was fine. tp->snd_holes is an ordered list - * of holes (oldest to newest, in terms of the sequence space). - */ + * of holes (oldest to newest, in terms of the sequence space). + */ int tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) -{ +{ int tmp_olen; u_char *tmp_cp; struct sackhole *cur, *p, *temp; - + if (tp->sack_disable) return (1); - + /* Note: TCPOLEN_SACK must be 2*sizeof(tcp_seq) */ if (optlen <= 2 || (optlen - 2) % TCPOLEN_SACK != 0) return (1); @@ -2527,9 +2527,9 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) panic("tcp_sack_option"); /* Should never happen */ while (tmp_olen > 0) { struct sackblk sack; - + bcopy(tmp_cp, (char *) &(sack.start), sizeof(tcp_seq)); - NTOHL(sack.start); + NTOHL(sack.start); bcopy(tmp_cp + sizeof(tcp_seq), (char *) &(sack.end), sizeof(tcp_seq)); NTOHL(sack.end); @@ -2537,7 +2537,7 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) tmp_cp += TCPOLEN_SACK; if (SEQ_LEQ(sack.end, sack.start)) continue; /* bad SACK fields */ - if (SEQ_LEQ(sack.end, tp->snd_una)) + if (SEQ_LEQ(sack.end, tp->snd_una)) continue; /* old block */ #if defined(TCP_SACK) && defined(TCP_FACK) /* Updates snd_fack. */ @@ -2555,7 +2555,7 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) pool_get(&sackhl_pool, PR_NOWAIT); if (tp->snd_holes == NULL) { /* ENOBUFS, so ignore SACKed block for now*/ - continue; + continue; } cur = tp->snd_holes; cur->start = th->th_ack; @@ -2564,11 +2564,11 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) cur->next = NULL; tp->snd_numholes = 1; tp->rcv_lastsack = sack.end; - /* - * dups is at least one. If more data has been + /* + * dups is at least one. If more data has been * SACKed, it can be greater than one. */ - cur->dups = min(tcprexmtthresh, + cur->dups = min(tcprexmtthresh, ((sack.end - cur->end)/tp->t_maxseg)); if (cur->dups < 1) cur->dups = 1; @@ -2577,8 +2577,8 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) /* Go thru list of holes: p = previous, cur = current */ p = cur = tp->snd_holes; while (cur) { - if (SEQ_LEQ(sack.end, cur->start)) - /* SACKs data before the current hole */ + if (SEQ_LEQ(sack.end, cur->start)) + /* SACKs data before the current hole */ break; /* no use going through more holes */ if (SEQ_GEQ(sack.start, cur->end)) { /* SACKs data beyond the current hole */ @@ -2594,12 +2594,12 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) /* Data acks at least the beginning of hole */ #if defined(TCP_SACK) && defined(TCP_FACK) if (SEQ_GT(sack.end, cur->rxmit)) - tp->retran_data -= - tcp_seq_subtract(cur->rxmit, + tp->retran_data -= + tcp_seq_subtract(cur->rxmit, cur->start); else tp->retran_data -= - tcp_seq_subtract(sack.end, + tcp_seq_subtract(sack.end, cur->start); #endif /* TCP_FACK */ if (SEQ_GEQ(sack.end, cur->end)) { @@ -2627,9 +2627,9 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) /* move end of hole backward */ if (SEQ_GEQ(sack.end, cur->end)) { #if defined(TCP_SACK) && defined(TCP_FACK) - if (SEQ_GT(cur->rxmit, sack.start)) - tp->retran_data -= - tcp_seq_subtract(cur->rxmit, + if (SEQ_GT(cur->rxmit, sack.start)) + tp->retran_data -= + tcp_seq_subtract(cur->rxmit, sack.start); #endif /* TCP_FACK */ cur->end = sack.start; @@ -2644,22 +2644,22 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) } if (SEQ_LT(cur->start, sack.start) && SEQ_GT(cur->end, sack.end)) { - /* - * ACKs some data in middle of a hole; need to + /* + * ACKs some data in middle of a hole; need to * split current hole */ temp = (struct sackhole *) pool_get(&sackhl_pool, PR_NOWAIT); - if (temp == NULL) + if (temp == NULL) continue; /* ENOBUFS */ #if defined(TCP_SACK) && defined(TCP_FACK) - if (SEQ_GT(cur->rxmit, sack.end)) - tp->retran_data -= - tcp_seq_subtract(sack.end, + if (SEQ_GT(cur->rxmit, sack.end)) + tp->retran_data -= + tcp_seq_subtract(sack.end, sack.start); else if (SEQ_GT(cur->rxmit, sack.start)) - tp->retran_data -= - tcp_seq_subtract(cur->rxmit, + tp->retran_data -= + tcp_seq_subtract(cur->rxmit, sack.start); #endif /* TCP_FACK */ temp->next = cur->next; @@ -2687,11 +2687,11 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) */ temp = (struct sackhole *) pool_get(&sackhl_pool, PR_NOWAIT); - if (temp == NULL) + if (temp == NULL) continue; /* ENOBUFS */ temp->start = tp->rcv_lastsack; temp->end = sack.start; - temp->dups = min(tcprexmtthresh, + temp->dups = min(tcprexmtthresh, ((sack.end - sack.start)/tp->t_maxseg)); if (temp->dups < 1) temp->dups = 1; @@ -2703,8 +2703,8 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) } } #if defined(TCP_SACK) && defined(TCP_FACK) - /* - * Update retran_data and snd_awnd. Go through the list of + /* + * Update retran_data and snd_awnd. Go through the list of * holes. Increment retran_data by (hole->rxmit - hole->start). */ tp->retran_data = 0; @@ -2713,16 +2713,16 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen) tp->retran_data += cur->rxmit - cur->start; cur = cur->next; } - tp->snd_awnd = tcp_seq_subtract(tp->snd_nxt, tp->snd_fack) + + tp->snd_awnd = tcp_seq_subtract(tp->snd_nxt, tp->snd_fack) + tp->retran_data; #endif /* TCP_FACK */ return (0); -} +} /* * Delete stale (i.e, cumulatively ack'd) holes. Hole is deleted only if - * it is completely acked; otherwise, tcp_sack_option(), called from + * it is completely acked; otherwise, tcp_sack_option(), called from * tcp_dooptions(), will fix up the hole. */ void @@ -2753,7 +2753,7 @@ tcp_del_sackholes(tp, th) } } -/* +/* * Delete all receiver-side SACK information. */ void @@ -2768,7 +2768,7 @@ tcp_clean_sackreport(tp) } -/* +/* * Checks for partial ack. If partial ack arrives, turn off retransmission * timer, deflate the window, do not clear tp->t_dupacks, and return 1. * If the ack advances at least to tp->snd_last, return 0. @@ -2783,8 +2783,8 @@ tcp_sack_partialack(tp, th) TCP_TIMER_DISARM(tp, TCPT_REXMT); tp->t_rtttime = 0; #ifndef TCP_FACK - /* - * Partial window deflation. This statement relies on the + /* + * Partial window deflation. This statement relies on the * fact that tp->snd_una has not been updated yet. In FACK * hold snd_cwnd constant during fast recovery. */ @@ -2814,7 +2814,7 @@ tcp_pulloutofband(so, urgent, m, off) int off; { int cnt = off + urgent - 1; - + while (cnt >= 0) { if (m->m_len > cnt) { char *cp = mtod(m, caddr_t) + cnt; @@ -2875,7 +2875,7 @@ tcp_xmit_timer(tp, rtt) if ((tp->t_rttvar += delta) <= 0) tp->t_rttvar = 1; } else { - /* + /* * No rtt measurement yet - use the unsmoothed rtt. * Set the variance to half the rtt (so our first * retransmit happens at 3*rtt). @@ -2902,7 +2902,7 @@ tcp_xmit_timer(tp, rtt) else rttmin = rtt + 2; TCPT_RANGESET(tp->t_rxtcur, TCP_REXMTVAL(tp), rttmin, TCPTV_REXMTMAX); - + /* * We received an ack for a packet that wasn't retransmitted; * it is probably safe to discard any error indications we've @@ -2989,7 +2989,7 @@ tcp_mss(tp, offer) if (!ifp) /* * ifp may be null and rmx_mtu may be zero in certain - * v6 cases (e.g., if ND wasn't able to resolve the + * v6 cases (e.g., if ND wasn't able to resolve the * destination host. */ goto out; @@ -3041,7 +3041,7 @@ tcp_mss(tp, offer) */ tp->t_maxopd = mss; - if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && + if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP) mss -= TCPOLEN_TSTAMP_APPA; @@ -3055,7 +3055,7 @@ tcp_mss(tp, offer) */ tp->snd_cwnd = ulmax((tp->snd_cwnd / tp->t_maxseg) * mss, mss); - } + } } else tp->snd_cwnd = mss; @@ -3171,7 +3171,7 @@ tcp_mss_update(tp) #endif /* TUBA_INCLUDE */ #if defined (TCP_SACK) -/* +/* * Checks for partial ack. If partial ack arrives, force the retransmission * of the next unacknowledged segment, do not clear tp->t_dupacks, and return * 1. By setting snd_nxt to ti_ack, this forces retransmission timer to @@ -3194,18 +3194,18 @@ tcp_newreno(tp, th) TCP_TIMER_DISARM(tp, TCPT_REXMT); tp->t_rtttime = 0; tp->snd_nxt = th->th_ack; - /* + /* * Set snd_cwnd to one segment beyond acknowledged offset * (tp->snd_una not yet updated when this function is called) - */ + */ tp->snd_cwnd = tp->t_maxseg + (th->th_ack - tp->snd_una); (void) tcp_output(tp); tp->snd_cwnd = ocwnd; if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; - /* - * Partial window deflation. Relies on fact that tp->snd_una - * not updated yet. + /* + * Partial window deflation. Relies on fact that tp->snd_una + * not updated yet. */ tp->snd_cwnd -= (th->th_ack - tp->snd_una - tp->t_maxseg); return 1; |