summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Pilloud <andrewpilloud@igneoussystems.com>2015-11-04 12:10:24 -0800
committerAndrew Pilloud <andrewpilloud@igneoussystems.com>2015-11-05 07:13:18 -0800
commit3475eb0416efc371a00a846b81aa9657c6951d29 (patch)
treefd1fc6b2bbffb4858eef740ea0a99b8987b2ae03
parentb921ab63efeb3354040a0eda0f7484acb5fa39e7 (diff)
downloadpfsense-3475eb0416efc371a00a846b81aa9657c6951d29.zip
pfsense-3475eb0416efc371a00a846b81aa9657c6951d29.tar.gz
Make DHCP deny action configurable
-rw-r--r--src/etc/inc/services.inc10
-rw-r--r--src/usr/local/www/services_dhcp.php10
2 files changed, 17 insertions, 3 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc
index a198a35..58467fb 100644
--- a/src/etc/inc/services.inc
+++ b/src/etc/inc/services.inc
@@ -776,20 +776,24 @@ EOPP;
}
$dhcpdconf .= " allow members of \"" . str_replace(':', '', $mac) . "\";\n";
}
+ $deny_action = "deny";
+ if (isset($poolconf['nonak'])) {
+ $deny_action = "ignore";
+ }
$mac_deny_list = array_unique(explode(',', $poolconf['mac_deny']));
foreach ($mac_deny_list as $mac) {
if (empty($mac)) {
continue;
}
- $dhcpdconf .= " deny members of \"" . str_replace(':', '', $mac) . "\";\n";
+ $dhcpdconf .= " $deny_action members of \"" . str_replace(':', '', $mac) . "\";\n";
}
if ($poolconf['failover_peerip'] <> "") {
- $dhcpdconf .= " deny dynamic bootp clients;\n";
+ $dhcpdconf .= " $deny_action dynamic bootp clients;\n";
}
if (isset($poolconf['denyunknown'])) {
- $dhcpdconf .= " deny unknown-clients;\n";
+ $dhcpdconf .= " $deny_action unknown-clients;\n";
}
if ($poolconf['gateway'] && $poolconf['gateway'] != "none" && ($poolconf['gateway'] != $dhcpifconf['gateway'])) {
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index cccb201..d24dd8f 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -183,6 +183,7 @@ if (is_array($dhcpdconf)) {
list($pconfig['wins1'], $pconfig['wins2']) = $dhcpdconf['winsserver'];
list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $dhcpdconf['dnsserver'];
$pconfig['denyunknown'] = isset($dhcpdconf['denyunknown']);
+ $pconfig['nonak'] = isset($dhcpdconf['nonak']);
$pconfig['ddnsdomain'] = $dhcpdconf['ddnsdomain'];
$pconfig['ddnsdomainprimary'] = $dhcpdconf['ddnsdomainprimary'];
$pconfig['ddnsdomainkeyname'] = $dhcpdconf['ddnsdomainkeyname'];
@@ -540,6 +541,7 @@ if (isset($_POST['submit'])) {
$dhcpdconf['domain'] = $_POST['domain'];
$dhcpdconf['domainsearchlist'] = $_POST['domainsearchlist'];
$dhcpdconf['denyunknown'] = ($_POST['denyunknown']) ? true : false;
+ $dhcpdconf['nonak'] = ($_POST['nonak']) ? true : false;
$dhcpdconf['ddnsdomain'] = $_POST['ddnsdomain'];
$dhcpdconf['ddnsdomainprimary'] = $_POST['ddnsdomainprimary'];
$dhcpdconf['ddnsdomainkeyname'] = $_POST['ddnsdomainkeyname'];
@@ -773,6 +775,14 @@ $section->addInput(new Form_Checkbox(
$pconfig['denyunknown']
));
+$section->addInput(new Form_Checkbox(
+ 'nonak',
+ 'Ignore denied clients',
+ 'Denied clients will be ignored rather than rejected.',
+ $pconfig['nonak']
+));
+
+
if (is_numeric($pool) || ($act == "newpool")) {
$section->addInput(new Form_Input(
'descr',
OpenPOWER on IntegriCloud