Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

DHCP Server enable/disable change needs filter_configure #665

Merged
merged 1 commit into from

2 participants

@phil-davis

I was checking what filter rules come and go when DHCP Server is enable or disabled on an interface. I discovered that the pf ruleset was not being rebuilt. I had to go and do some other edit/save to rules or aliases to trigger the filter_configure.
When DHCP Server is enabled or disabled on an interface, the filter rules should be rebuilt so they include or not mention DHCP as per the new DHCP Server setting.
Note: this is also a fix for 2.1 - it should apply cleanly there. When you commit this, can you do the magic to also apply it to the 2.1 branch?

Phil Davis DHCP Server enable/disable change needs filter_configure
When DHCP Server is enabled or disabled on an interface, the filter rules should change to include or not mention DHCP.
6c12421
@cbuechler cbuechler merged commit 9152338 into pfsense:master
@cbuechler
Owner

cherry-picked to RELENG_2_1 also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 1, 2013
  1. DHCP Server enable/disable change needs filter_configure

    Phil Davis authored
    When DHCP Server is enabled or disabled on an interface, the filter rules should change to include or not mention DHCP.
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 2 deletions.
  1. +14 −2 usr/local/www/services_dhcp.php
View
16 usr/local/www/services_dhcp.php
@@ -41,6 +41,7 @@
##|-PRIV
require("guiconfig.inc");
+require_once("filter.inc");
if(!$g['services_dhcp_server_enable']) {
Header("Location: /");
@@ -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'])
@@ -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);
}
Something went wrong with that request. Please try again.