From owner-svn-src-head@FreeBSD.ORG Sat May 30 11:14:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7394106566B; Sat, 30 May 2009 11:14:41 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57C38FC12; Sat, 30 May 2009 11:14:41 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4UBEfXL006570; Sat, 30 May 2009 11:14:41 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4UBEf9C006567; Sat, 30 May 2009 11:14:41 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200905301114.n4UBEf9C006567@svn.freebsd.org> From: Randall Stewart Date: Sat, 30 May 2009 11:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193090 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2009 11:14:42 -0000 Author: rrs Date: Sat May 30 11:14:41 2009 New Revision: 193090 URL: http://svn.freebsd.org/changeset/base/193090 Log: Adds missing sysctl to manage the vtag_time_wait time. This will even allow disabling time-wait all together if you set the value to 0 (not advisable actually). The default remains the same i.e. 60 seconds. Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat May 30 10:56:27 2009 (r193089) +++ head/sys/netinet/sctp_pcb.c Sat May 30 11:14:41 2009 (r193090) @@ -4311,6 +4311,10 @@ sctp_add_vtag_to_timewait(uint32_t tag, struct timeval now; int set, i; + if (time == 0) { + /* Its disabled */ + return; + } (void)SCTP_GETTIME_TIMEVAL(&now); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; @@ -4662,7 +4666,8 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* pull from vtag hash */ LIST_REMOVE(stcb, sctp_asocs); - sctp_add_vtag_to_timewait(asoc->my_vtag, SCTP_TIME_WAIT, inp->sctp_lport, stcb->rport); + sctp_add_vtag_to_timewait(asoc->my_vtag, SCTP_BASE_SYSCTL(sctp_vtag_time_wait), + inp->sctp_lport, stcb->rport); /* * Now restop the timers to be sure - this is paranoia at is finest! Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sat May 30 10:56:27 2009 (r193089) +++ head/sys/netinet/sctp_sysctl.c Sat May 30 11:14:41 2009 (r193090) @@ -105,6 +105,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_default_frag_interleave) = SCTPCTL_DEFAULT_FRAG_INTERLEAVE_DEFAULT; SCTP_BASE_SYSCTL(sctp_mobility_base) = SCTPCTL_MOBILITY_BASE_DEFAULT; SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff) = SCTPCTL_MOBILITY_FASTHANDOFF_DEFAULT; + SCTP_BASE_SYSCTL(sctp_vtag_time_wait) = SCTPCTL_TIME_WAIT_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); #endif @@ -610,6 +611,8 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_logging_level), SCTPCTL_LOGGING_LEVEL_MIN, SCTPCTL_LOGGING_LEVEL_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_default_cc_module), SCTPCTL_DEFAULT_CC_MODULE_MIN, SCTPCTL_DEFAULT_CC_MODULE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_default_frag_interleave), SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MIN, SCTPCTL_DEFAULT_FRAG_INTERLEAVE_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_vtag_time_wait), SCTPCTL_TIME_WAIT_MIN, SCTPCTL_TIME_WAIT_MAX); + #if defined(__FreeBSD__) || defined(SCTP_APPLE_MOBILITY_BASE) RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_base), SCTPCTL_MOBILITY_BASE_MIN, SCTPCTL_MOBILITY_BASE_MAX); #endif @@ -909,6 +912,10 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, na &SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), 0, sysctl_sctp_check, "IU", SCTPCTL_NAT_FRIENDLY_DESC); +SYSCTL_PROC(_net_inet_sctp, OID_AUTO, vtag_time_wait, CTLTYPE_INT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_vtag_time_wait), 0, sysctl_sctp_check, "IU", + SCTPCTL_TIME_WAIT_DESC); + #ifdef SCTP_DEBUG SYSCTL_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_INT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sat May 30 10:56:27 2009 (r193089) +++ head/sys/netinet/sctp_sysctl.h Sat May 30 11:14:41 2009 (r193090) @@ -104,6 +104,7 @@ struct sctp_sysctl { uint32_t sctp_udp_tunneling_for_client_enable; uint32_t sctp_udp_tunneling_port; uint32_t sctp_enable_sack_immediately; + uint32_t sctp_vtag_time_wait; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -482,6 +483,13 @@ struct sctp_sysctl { #define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT SCTPCTL_NAT_FRIENDLY_INITS_MIN +/* Vtag tiem wait bits */ +#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time 0 disables." +#define SCTPCTL_TIME_WAIT_MIN 0 +#define SCTPCTL_TIME_WAIT_MAX 0xffffffff +#define SCTPCTL_TIME_WAIT_DEFAULT SCTP_TIME_WAIT + + #if defined(SCTP_DEBUG) /* debug: Configure debug output */ #define SCTPCTL_DEBUG_DESC "Configure debug output"