Skip to content

Commit

Permalink
DHCP Server enable/disable change needs filter_configure
Browse files Browse the repository at this point in the history
When DHCP Server is enabled or disabled on an interface, the filter rules should change to include or not mention DHCP.
  • Loading branch information
Phil Davis committed Jun 1, 2013
1 parent 9399370 commit 6c12421
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions usr/local/www/services_dhcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
##|-PRIV

require("guiconfig.inc");
require_once("filter.inc");

if(!$g['services_dhcp_server_enable']) {
Header("Location: /");
Expand Down Expand Up @@ -424,9 +425,17 @@ function validate_partial_mac_list($maclist) {
if (!is_array($dhcpdconf['range']))
$dhcpdconf['range'] = array();

$dhcpd_enable_changed = false;

// Global Options
if (!is_numeric($pool) && !($act == "newpool")) {
$dhcpdconf['enable'] = ($_POST['enable']) ? true : false;
$old_dhcpd_enable = isset($dhcpdconf['enable']);
$new_dhcpd_enable = ($_POST['enable']) ? true : false;
if ($old_dhcpd_enable != $new_dhcpd_enable) {
/* DHCP has been enabled or disabled. The pf ruleset will need to be rebuilt to allow or disallow DHCP. */
$dhcpd_enable_changed = true;
}
$dhcpdconf['enable'] = $new_dhcpd_enable;
$dhcpdconf['staticarp'] = ($_POST['staticarp']) ? true : false;
$previous = $dhcpdconf['failover_peerip'];
if($previous <> $_POST['failover_peerip'])
Expand Down Expand Up @@ -514,7 +523,10 @@ function validate_partial_mac_list($maclist) {
if ($retvaldhcp == 0)
clear_subsystem_dirty('staticmaps');
}
if($retvaldhcp == 1 || $retvaldns == 1)
if ($dhcpd_enable_changed)
$retvalfc = filter_configure();

if($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1)
$retval = 1;
$savemsg = get_std_save_message($retval);
}
Expand Down

0 comments on commit 6c12421

Please sign in to comment.