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.
This commit is contained in:
parent
bf1be57101
commit
a16ccdcead
@ -4311,6 +4311,10 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint32_t time, uint16_t lport, uint16_t
|
||||
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, struct sctp_tcb *stcb, int from_inpcbfre
|
||||
}
|
||||
/* 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!
|
||||
|
@ -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, nat_friendly_init, CTLTYPE_INT | CTLFLAG_R
|
||||
&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",
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user