on all connections by mistake (still needs more work to do keeps more
persistantly!)
SCCS-vsn: sys/netinet/tcp_debug.h 4.2
SCCS-vsn: sys/netinet/tcp_input.c 1.63
SCCS-vsn: sys/netinet/tcp_subr.c 4.19
SCCS-vsn: sys/netinet/tcp_timer.c 4.18
-/* tcp_debug.h 4.1 81/12/22 */
+/* tcp_debug.h 4.2 82/03/24 */
struct tcp_debug {
n_time td_time;
struct tcp_debug {
n_time td_time;
#define TA_INPUT 0
#define TA_OUTPUT 1
#define TA_USER 2
#define TA_INPUT 0
#define TA_OUTPUT 1
#define TA_USER 2
+#define TA_RESPOND 3
+#define TA_DROP 4
-char *tanames[] = { "input", "output", "user" };
+char *tanames[] =
+ { "input", "output", "user", "respond", "drop" };
#endif
#define TCP_NDEBUG 100
#endif
#define TCP_NDEBUG 100
-/* tcp_input.c 1.62 82/03/19 */
+/* tcp_input.c 1.63 82/03/24 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
if ((tiflags&TH_RST) ||
tlen == 0 && (tiflags&(TH_SYN|TH_FIN)) == 0)
goto drop;
if ((tiflags&TH_RST) ||
tlen == 0 && (tiflags&(TH_SYN|TH_FIN)) == 0)
goto drop;
+ if (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)
+ tcp_trace(TA_RESPOND, ostate, tp, &tcp_saveti, 0);
tcp_respond(tp, ti, tp->rcv_nxt, tp->snd_nxt, TH_ACK);
return;
tcp_respond(tp, ti, tp->rcv_nxt, tp->snd_nxt, TH_ACK);
return;
/*
* Drop space held by incoming segment and return.
*/
/*
* Drop space held by incoming segment and return.
*/
+ if (tp && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG))
+ tcp_trace(TA_DROP, ostate, tp, &tcp_saveti, 0);
-/* tcp_subr.c 4.18 82/03/15 */
+/* tcp_subr.c 4.19 82/03/24 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
ti->ti_win = htons(ti->ti_win);
#endif
ti->ti_urp = 0;
ti->ti_win = htons(ti->ti_win);
#endif
ti->ti_urp = 0;
- ti->ti_sum = in_cksum(m, sizeof(struct tcpiphdr));
+ ti->ti_sum = in_cksum(m, sizeof (struct tcpiphdr) + tlen);
((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + tlen;
((struct ip *)ti)->ip_ttl = TCP_TTL;
(void) ip_output(m, (struct mbuf *)0, 0);
((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + tlen;
((struct ip *)ti)->ip_ttl = TCP_TTL;
(void) ip_output(m, (struct mbuf *)0, 0);
-/* tcp_timer.c 4.17 82/03/19 */
+/* tcp_timer.c 4.18 82/03/24 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
* or drop connection if idle for too long.
*/
case TCPT_KEEP:
* or drop connection if idle for too long.
*/
case TCPT_KEEP:
- if (tp->t_state < TCPS_ESTABLISHED ||
- tp->t_idle >= TCPTV_MAXIDLE) {
- tcp_drop(tp, ETIMEDOUT);
- return;
- }
+ if (tp->t_state < TCPS_ESTABLISHED)
+ goto dropit;
if (tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) {
if (tp->t_inpcb->inp_socket->so_options & SO_KEEPALIVE) {
+ if (tp->t_idle >= TCPTV_MAXIDLE)
+ goto dropit;
/*
* Saying tp->rcv_nxt-1 lies about what
* we have received, and by the protocol spec
/*
* Saying tp->rcv_nxt-1 lies about what
* we have received, and by the protocol spec
tp->t_idle = 0;
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
return;
tp->t_idle = 0;
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
return;
+ dropit:
+ tcp_drop(tp, ETIMEDOUT);
+ return;