SCCS-vsn: sys/netinet/tcp_timer.c 7.3
SCCS-vsn: sys/netinet/tcp_subr.c 7.4
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)tcp_subr.c 7.3 (Berkeley) %G%
+ * @(#)tcp_subr.c 7.4 (Berkeley) %G%
tcp_seq ack, seq;
int flags;
{
tcp_seq ack, seq;
int flags;
{
+ register struct mbuf *m;
int win = 0, tlen;
struct route *ro = 0;
int win = 0, tlen;
struct route *ro = 0;
+ extern int tcp_keeplen;
if (tp) {
win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
if (tp) {
win = sbspace(&tp->t_inpcb->inp_socket->so_rcv);
m = m_get(M_DONTWAIT, MT_HEADER);
if (m == NULL)
return;
m = m_get(M_DONTWAIT, MT_HEADER);
if (m == NULL)
return;
- m->m_len = sizeof (struct tcpiphdr) + 1;
+ tlen = tcp_keeplen;
+ m->m_len = sizeof (struct tcpiphdr) + tlen;
*mtod(m, struct tcpiphdr *) = *ti;
ti = mtod(m, struct tcpiphdr *);
flags = TH_ACK;
*mtod(m, struct tcpiphdr *) = *ti;
ti = mtod(m, struct tcpiphdr *);
flags = TH_ACK;
m_freem(m->m_next);
m->m_next = 0;
m->m_off = (int)ti - (int)m;
m_freem(m->m_next);
m->m_next = 0;
m->m_off = (int)ti - (int)m;
m->m_len = sizeof (struct tcpiphdr);
#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
xchg(ti->ti_dport, ti->ti_sport, u_short);
#undef xchg
}
m->m_len = sizeof (struct tcpiphdr);
#define xchg(a,b,type) { type t; t=a; a=b; b=t; }
xchg(ti->ti_dst.s_addr, ti->ti_src.s_addr, u_long);
xchg(ti->ti_dport, ti->ti_sport, u_short);
#undef xchg
}
ti->ti_next = ti->ti_prev = 0;
ti->ti_x1 = 0;
ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
ti->ti_next = ti->ti_prev = 0;
ti->ti_x1 = 0;
ti->ti_len = htons((u_short)(sizeof (struct tcphdr) + tlen));
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)tcp_timer.c 7.2 (Berkeley) %G%
+ * @(#)tcp_timer.c 7.3 (Berkeley) %G%
int tcp_backoff[TCP_MAXRXTSHIFT+1] =
{ 1, 2, 4, 6, 8, 10, 15, 20, 30, 30, 30, 30, 30 };
int tcp_backoff[TCP_MAXRXTSHIFT+1] =
{ 1, 2, 4, 6, 8, 10, 15, 20, 30, 30, 30, 30, 30 };
+#ifdef TCP_COMPAT_42
+int tcp_keeplen = 1;
+#else
+int tcp_keeplen = 0;
+#endif
+
/*
* TCP timer processing.
*/
/*
* TCP timer processing.
*/
* correspondent TCP to respond.
*/
tcpstat.tcps_keepprobe++;
* correspondent TCP to respond.
*/
tcpstat.tcps_keepprobe++;
- tcp_respond(tp,
- tp->t_template, tp->rcv_nxt, tp->snd_una-1, 0);
+ tcp_respond(tp, tp->t_template,
+ tp->rcv_nxt - tcp_keeplen, tp->snd_una - 1, 0);
}
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
break;
}
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
break;