summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-03-24 10:19:07 +0000
committerglebius <glebius@FreeBSD.org>2014-03-24 10:19:07 +0000
commitb117682e181009e97f463bf89d30a4dbfaa92b24 (patch)
treeff9e949bf926fafb4f9c0d24f91d82f2d01cea38
parent94058dd92318dce73cbd49aac383c9926dfec76f (diff)
downloadFreeBSD-src-b117682e181009e97f463bf89d30a4dbfaa92b24.zip
FreeBSD-src-b117682e181009e97f463bf89d30a4dbfaa92b24.tar.gz
Merge r263497: fix ipfw + VIMAGE sysctls.
PR: kern/187665
-rw-r--r--sys/netpfil/ipfw/ip_fw_pfil.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c
index 79973b1..99517ed 100644
--- a/sys/netpfil/ipfw/ip_fw_pfil.c
+++ b/sys/netpfil/ipfw/ip_fw_pfil.c
@@ -536,30 +536,22 @@ ipfw_attach_hooks(int arg)
int
ipfw_chg_hook(SYSCTL_HANDLER_ARGS)
{
- int *enable;
int newval;
int error;
int af;
- if (arg1 == &VNET_NAME(fw_enable)) {
- enable = &V_fw_enable;
+ if (arg1 == &V_fw_enable)
af = AF_INET;
- }
#ifdef INET6
- else if (arg1 == &VNET_NAME(fw6_enable)) {
- enable = &V_fw6_enable;
+ else if (arg1 == &V_fw6_enable)
af = AF_INET6;
- }
#endif
- else if (arg1 == &VNET_NAME(fwlink_enable)) {
- enable = &V_fwlink_enable;
+ else if (arg1 == &V_fwlink_enable)
af = AF_LINK;
- }
else
return (EINVAL);
- newval = *enable;
-
+ newval = *(int *)arg1;
/* Handle sysctl change */
error = sysctl_handle_int(oidp, &newval, 0, req);
@@ -569,13 +561,13 @@ ipfw_chg_hook(SYSCTL_HANDLER_ARGS)
/* Formalize new value */
newval = (newval) ? 1 : 0;
- if (*enable == newval)
+ if (*(int *)arg1 == newval)
return (0);
error = ipfw_hook(newval, af);
if (error)
return (error);
- *enable = newval;
+ *(int *)arg1 = newval;
return (0);
}
OpenPOWER on IntegriCloud