}
/*
- * Set the slow-start flight size depending on whether this
- * is a local network or not.
+ * Set the slow-start flight size
+ *
+ * NOTE: t_maxseg must have been configured!
*/
- if (tcp_do_rfc3390)
- tp->snd_cwnd = min(4 * mss, max(2 * mss, 4380));
- else
- tp->snd_cwnd = mss;
+ tp->snd_cwnd = tcp_initial_window(tp);
if (rt->rt_rmx.rmx_ssthresh) {
/*
tp->snd_bwnd = bwnd;
}
+u_long
+tcp_initial_window(const struct tcpcb *tp)
+{
+ if (tcp_do_rfc3390)
+ return min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380));
+ else
+ return tp->t_maxseg;
+}
+
#ifdef TCP_SIGNATURE
/*
* Compute TCP-MD5 hash of a TCP segment. (RFC2385)
void tcp_trace (short, short, struct tcpcb *, void *, struct tcphdr *,
int);
void tcp_xmit_bandwidth_limit(struct tcpcb *tp, tcp_seq ack_seq);
+u_long tcp_initial_window(const struct tcpcb *tp);
void tcp_timer_keep_activity(struct tcpcb *tp, int thflags);
void syncache_init(void);
void syncache_unreach(struct in_conninfo *, struct tcphdr *);