Change SCTP sysctl from auth_disable to auth_enable. This is

consistent with other similar sysctl variable used in SCTP.
This commit is contained in:
Michael Tuexen 2014-08-12 13:13:11 +00:00
parent c397297cfe
commit 97a0ca5b3e
3 changed files with 18 additions and 22 deletions

View File

@ -2485,11 +2485,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
inp->sctp_cmt_on_off = SCTP_BASE_SYSCTL(sctp_cmt_on_off);
inp->ecn_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_ecn_enable);
inp->prsctp_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_pr_enable);
if (SCTP_BASE_SYSCTL(sctp_auth_disable)) {
inp->auth_supported = 0;
} else {
inp->auth_supported = 1;
}
inp->auth_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_auth_enable);
inp->asconf_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_asconf_enable);
inp->reconfig_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_reconfig_enable);
inp->nrsack_supported = (uint8_t) SCTP_BASE_SYSCTL(sctp_nrsack_enable);

View File

@ -55,7 +55,7 @@ sctp_init_sysctls()
SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT;
SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_pr_enable) = SCTPCTL_PR_ENABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_reconfig_enable) = SCTPCTL_RECONFIG_ENABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT;
@ -684,19 +684,19 @@ sysctl_sctp_auth_check(SYSCTL_HANDLER_ARGS)
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
if (error == 0) {
if (SCTP_BASE_SYSCTL(sctp_auth_disable) < SCTPCTL_AUTH_DISABLE_MIN) {
SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MIN;
if (SCTP_BASE_SYSCTL(sctp_auth_enable) < SCTPCTL_AUTH_ENABLE_MIN) {
SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_MIN;
}
if (SCTP_BASE_SYSCTL(sctp_auth_disable) > SCTPCTL_AUTH_DISABLE_MAX) {
SCTP_BASE_SYSCTL(sctp_auth_disable) = SCTPCTL_AUTH_DISABLE_MAX;
if (SCTP_BASE_SYSCTL(sctp_auth_enable) > SCTPCTL_AUTH_ENABLE_MAX) {
SCTP_BASE_SYSCTL(sctp_auth_enable) = SCTPCTL_AUTH_ENABLE_MAX;
}
if ((SCTP_BASE_SYSCTL(sctp_auth_disable) == 1) &&
if ((SCTP_BASE_SYSCTL(sctp_auth_enable) == 0) &&
(SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1)) {
/*
* You can't disable AUTH with disabling ASCONF
* first
*/
SCTP_BASE_SYSCTL(sctp_auth_disable) = 0;
SCTP_BASE_SYSCTL(sctp_auth_enable) = 1;
}
}
return (error);
@ -716,7 +716,7 @@ sysctl_sctp_asconf_check(SYSCTL_HANDLER_ARGS)
SCTP_BASE_SYSCTL(sctp_asconf_enable) = SCTPCTL_ASCONF_ENABLE_MAX;
}
if ((SCTP_BASE_SYSCTL(sctp_asconf_enable) == 1) &&
(SCTP_BASE_SYSCTL(sctp_auth_disable) == 1)) {
(SCTP_BASE_SYSCTL(sctp_auth_enable) == 0)) {
/*
* You can't enable ASCONF without enabling AUTH
* first
@ -919,9 +919,9 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, pr_enable, CTLTYPE_UINT | CTLFLAG_RW,
&SCTP_BASE_SYSCTL(sctp_pr_enable), 0, sysctl_sctp_check, "IU",
SCTPCTL_PR_ENABLE_DESC);
SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_disable, CTLTYPE_UINT | CTLFLAG_RW,
&SCTP_BASE_SYSCTL(sctp_auth_disable), 0, sysctl_sctp_auth_check, "IU",
SCTPCTL_AUTH_DISABLE_DESC);
SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, auth_enable, CTLTYPE_UINT | CTLFLAG_RW,
&SCTP_BASE_SYSCTL(sctp_auth_enable), 0, sysctl_sctp_auth_check, "IU",
SCTPCTL_AUTH_ENABLE_DESC);
SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, asconf_enable, CTLTYPE_UINT | CTLFLAG_RW,
&SCTP_BASE_SYSCTL(sctp_asconf_enable), 0, sysctl_sctp_asconf_check, "IU",

View File

@ -46,7 +46,7 @@ struct sctp_sysctl {
uint32_t sctp_multiple_asconfs;
uint32_t sctp_ecn_enable;
uint32_t sctp_pr_enable;
uint32_t sctp_auth_disable;
uint32_t sctp_auth_enable;
uint32_t sctp_asconf_enable;
uint32_t sctp_reconfig_enable;
uint32_t sctp_nrsack_enable;
@ -163,11 +163,11 @@ struct sctp_sysctl {
#define SCTPCTL_PR_ENABLE_MAX 1
#define SCTPCTL_PR_ENABLE_DEFAULT 1
/* auth_disable: Disable SCTP AUTH function */
#define SCTPCTL_AUTH_DISABLE_DESC "Disable SCTP AUTH function"
#define SCTPCTL_AUTH_DISABLE_MIN 0
#define SCTPCTL_AUTH_DISABLE_MAX 1
#define SCTPCTL_AUTH_DISABLE_DEFAULT 0
/* auth_enable: Enable SCTP AUTH function */
#define SCTPCTL_AUTH_ENABLE_DESC "Enable SCTP AUTH function"
#define SCTPCTL_AUTH_ENABLE_MIN 0
#define SCTPCTL_AUTH_ENABLE_MAX 1
#define SCTPCTL_AUTH_ENABLE_DEFAULT 1
/* asconf_enable: Enable SCTP ASCONF */
#define SCTPCTL_ASCONF_ENABLE_DESC "Enable SCTP ASCONF"