Module Name: src Committed By: maxv Date: Fri Jul 28 19:16:41 UTC 2017
Modified Files: src/sys/netinet: tcp_timer.c tcp_usrreq.c tcp_var.h Log Message: Remove TCP_COMPAT_42. This feature is a workaround for a bug in the TCP stack of BSD4.2. Having such features just does not make any sense, and looking at the code, I'm not sure it actually works. To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/netinet/tcp_timer.c cvs rdiff -u -r1.214 -r1.215 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.178 -r1.179 src/sys/netinet/tcp_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netinet/tcp_timer.c diff -u src/sys/netinet/tcp_timer.c:1.91 src/sys/netinet/tcp_timer.c:1.92 --- src/sys/netinet/tcp_timer.c:1.91 Mon Jul 25 00:10:38 2016 +++ src/sys/netinet/tcp_timer.c Fri Jul 28 19:16:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_timer.c,v 1.91 2016/07/25 00:10:38 knakahara Exp $ */ +/* $NetBSD: tcp_timer.c,v 1.92 2017/07/28 19:16:41 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -93,7 +93,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,v 1.91 2016/07/25 00:10:38 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_timer.c,v 1.92 2017/07/28 19:16:41 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -564,19 +564,11 @@ tcp_timer_keep(void *arg) * correspondent TCP to respond. */ TCP_STATINC(TCP_STAT_KEEPPROBE); - if (tcp_compat_42) { - /* - * The keepalive packet must have nonzero - * length to get a 4.2 host to respond. - */ - (void)tcp_respond(tp, tp->t_template, - NULL, NULL, tp->rcv_nxt - 1, - tp->snd_una - 1, 0); - } else { - (void)tcp_respond(tp, tp->t_template, - NULL, NULL, tp->rcv_nxt, - tp->snd_una - 1, 0); - } + + (void)tcp_respond(tp, tp->t_template, + NULL, NULL, tp->rcv_nxt, + tp->snd_una - 1, 0); + TCP_TIMER_ARM(tp, TCPT_KEEP, tp->t_keepintvl); } else TCP_TIMER_ARM(tp, TCPT_KEEP, tp->t_keepidle); Index: src/sys/netinet/tcp_usrreq.c diff -u src/sys/netinet/tcp_usrreq.c:1.214 src/sys/netinet/tcp_usrreq.c:1.215 --- src/sys/netinet/tcp_usrreq.c:1.214 Tue Jan 24 07:09:24 2017 +++ src/sys/netinet/tcp_usrreq.c Fri Jul 28 19:16:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_usrreq.c,v 1.214 2017/01/24 07:09:24 ozaki-r Exp $ */ +/* $NetBSD: tcp_usrreq.c,v 1.215 2017/07/28 19:16:41 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -99,7 +99,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.214 2017/01/24 07:09:24 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.215 2017/07/28 19:16:41 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -2152,12 +2152,6 @@ sysctl_net_inet_tcp_setup2(struct sysctl CTL_NET, pf, IPPROTO_TCP, TCPCTL_TSTAMP, CTL_EOL); sysctl_createv(clog, 0, NULL, NULL, CTLFLAG_PERMANENT|CTLFLAG_READWRITE, - CTLTYPE_INT, "compat_42", - SYSCTL_DESCR("Enable workarounds for 4.2BSD TCP bugs"), - NULL, 0, &tcp_compat_42, 0, - CTL_NET, pf, IPPROTO_TCP, TCPCTL_COMPAT_42, CTL_EOL); - sysctl_createv(clog, 0, NULL, NULL, - CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_INT, "cwm", SYSCTL_DESCR("Hughes/Touch/Heidemann Congestion Window " "Monitoring"), Index: src/sys/netinet/tcp_var.h diff -u src/sys/netinet/tcp_var.h:1.178 src/sys/netinet/tcp_var.h:1.179 --- src/sys/netinet/tcp_var.h:1.178 Fri Jul 7 01:37:34 2017 +++ src/sys/netinet/tcp_var.h Fri Jul 28 19:16:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: tcp_var.h,v 1.178 2017/07/07 01:37:34 ozaki-r Exp $ */ +/* $NetBSD: tcp_var.h,v 1.179 2017/07/28 19:16:41 maxv Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -811,7 +811,6 @@ extern int tcp_init_win; /* initial wind extern int tcp_init_win_local; /* initial window for local nets */ extern int tcp_init_win_max[11];/* max sizes for values of tcp_init_win_* */ extern int tcp_mss_ifmtu; /* take MSS from interface, not in_maxmtu */ -extern int tcp_compat_42; /* work around ancient broken TCP peers */ extern int tcp_cwm; /* enable Congestion Window Monitoring */ extern int tcp_cwm_burstsize; /* burst size allowed by CWM */ extern int tcp_ack_on_push; /* ACK immediately on PUSH */ @@ -877,7 +876,6 @@ extern int tcp_autosndbuf_max; { 1, 0, &tcp_do_sack }, \ { 1, 0, &tcp_do_win_scale }, \ { 1, 0, &tcp_do_timestamps }, \ - { 1, 0, &tcp_compat_42 }, \ { 1, 0, &tcp_cwm }, \ { 1, 0, &tcp_cwm_burstsize }, \ { 1, 0, &tcp_ack_on_push }, \