diff options
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r-- | etc/inc/services.inc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index c14615e..3b94885 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -655,14 +655,17 @@ EOPP; } $all_mac_strings[] = $dhcpifconf['mac_allow']; $all_mac_strings[] = $dhcpifconf['mac_deny']; - $all_mac_list = array_unique(explode(',', implode(',', $all_mac_strings))); - foreach ($all_mac_list as $mac) { - if (empty($mac)) - continue; - $dhcpdconf .= 'class "' . str_replace(':', '', $mac) . '" {' . "\n"; - // Skip the first octet of the MAC address - for media type, typically Ethernet ("01") and match the rest. - $dhcpdconf .= ' match if substring (hardware, 1, ' . (substr_count($mac, ':') + 1) . ') = ' . $mac . ';' . "\n"; - $dhcpdconf .= '}' . "\n"; + if (!empty($all_mac_strings)) { + $all_mac_list = array_unique(explode(',', implode(',', $all_mac_strings))); + foreach ($all_mac_list as $mac) { + if (empty($mac)) { + continue; + } + $dhcpdconf .= 'class "' . str_replace(':', '', $mac) . '" {' . "\n"; + // Skip the first octet of the MAC address - for media type, typically Ethernet ("01") and match the rest. + $dhcpdconf .= ' match if substring (hardware, 1, ' . (substr_count($mac, ':') + 1) . ') = ' . $mac . ';' . "\n"; + $dhcpdconf .= '}' . "\n"; + } } $dhcpdconf .= "subnet {$subnet} netmask {$subnetmask} {\n"; |