Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Mar 2014 17:07:18 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263497 - head/sys/netpfil/ipfw
Message-ID:  <201403211707.s2LH7IBN010202@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Fri Mar 21 17:07:18 2014
New Revision: 263497
URL: http://svnweb.freebsd.org/changeset/base/263497

Log:
  Fix breakage in ipfw+VIMAGE after r261590.
  
  PR:		kern/187665
  Sponsored by:	Nginx, Inc.

Modified:
  head/sys/netpfil/ipfw/ip_fw_pfil.c

Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_pfil.c	Fri Mar 21 16:57:34 2014	(r263496)
+++ head/sys/netpfil/ipfw/ip_fw_pfil.c	Fri Mar 21 17:07:18 2014	(r263497)
@@ -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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403211707.s2LH7IBN010202>