From owner-svn-src-all@FreeBSD.ORG Mon Mar 24 10:19:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1364384; Mon, 24 Mar 2014 10:19:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D509CA3; Mon, 24 Mar 2014 10:19:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2OAJ7Rp021228; Mon, 24 Mar 2014 10:19:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2OAJ79G021227; Mon, 24 Mar 2014 10:19:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403241019.s2OAJ79G021227@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 24 Mar 2014 10:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r263680 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 10:19:07 -0000 Author: glebius Date: Mon Mar 24 10:19:07 2014 New Revision: 263680 URL: http://svnweb.freebsd.org/changeset/base/263680 Log: Merge r263497: fix ipfw + VIMAGE sysctls. PR: kern/187665 Modified: stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Mon Mar 24 08:24:32 2014 (r263679) +++ stable/10/sys/netpfil/ipfw/ip_fw_pfil.c Mon Mar 24 10:19:07 2014 (r263680) @@ -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); }