summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-09-14 08:10:23 -0400
committerjim-p <jimp@pfsense.org>2012-09-14 08:10:23 -0400
commit80d30a83463f3ee8160bbd9b38cd2f2f510560d7 (patch)
tree3b18fbae3e02b6f0c36ec35b28f374e996334b87
parent1f1a08c85b7e8ddc6473795534ed5422a2c5aaaf (diff)
downloadpfsense-80d30a83463f3ee8160bbd9b38cd2f2f510560d7.zip
pfsense-80d30a83463f3ee8160bbd9b38cd2f2f510560d7.tar.gz
Add some safety checks against empty entries
-rw-r--r--etc/inc/services.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index ffc15e8..e3a2871 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -538,6 +538,8 @@ EOPP;
/* Create classes */
$all_mac_list = array_unique(explode(',', $dhcpifconf['mac_allow'] . ',' . $dhcpifconf['mac_deny']));
foreach ($all_mac_list as $mac) {
+ if (empty($mac))
+ continue;
$dhcpdconf .= 'class "' . str_replace(':', '', $mac) . '" {' . "\n";
$dhcpdconf .= ' match if substring (hardware, 1, ' . (substr_count($mac, ':') + 1) . ') = ' . $mac . ';' . "\n";
$dhcpdconf .= '}' . "\n";
@@ -557,10 +559,14 @@ EOPP;
/* allow/deny MACs */
$mac_allow_list = array_unique(explode(',', $dhcpifconf['mac_allow']));
foreach ($mac_allow_list as $mac) {
+ if (empty($mac))
+ continue;
$dhcpdconf .= " allow members of \"" . str_replace(':', '', $mac) . "\";\n";
}
$mac_deny_list = array_unique(explode(',', $dhcpifconf['mac_deny']));
foreach ($mac_deny_list as $mac) {
+ if (empty($mac))
+ continue;
$dhcpdconf .= " deny members of \"" . str_replace(':', '', $mac) . "\";\n";
}
OpenPOWER on IntegriCloud