Commit 8972c57e authored by Ad Schellevis's avatar Ad Schellevis

fix config handling on empty tags for dhcp / ipsec

parent 4e929dab
......@@ -5241,7 +5241,9 @@ function interfaces_staticarp_configure($if)
if (is_array($config['dhcpd'][$if]['staticmap'])) {
foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
if (isset($arpent['ipaddr'])) {
mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
}
}
......@@ -5252,11 +5254,13 @@ function interfaces_staticarp_configure($if)
if (isset($config['dhcpd'][$if]['staticmap'])) {
foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
if (isset($arpent['arp_table_static_entry'])) {
if (isset($arpent['ipaddr'])) {
mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
}
}
}
}
}
return 0;
}
......
......@@ -496,7 +496,7 @@ EOPP;
$all_pools = array();
$all_pools[] = $dhcpifconf;
if (is_array($dhcpifconf['pool'])) {
if (is_array($dhcpifconf['pool']) && isset($dhcpifconf['pool']['range']) ) {
$all_pools = array_merge($all_pools, $dhcpifconf['pool']);
}
......@@ -546,7 +546,7 @@ EOPP;
/* Create classes - These all contain comma separated lists. Join them into one
big comma separated string then split them all up. */
$all_mac_strings = array();
if (is_array($dhcpifconf['pool'])) {
if (is_array($dhcpifconf['pool']) && isset($dhcpifconf['pool']['range']) ) {
foreach($all_pools as $poolconf) {
$all_mac_strings[] = $poolconf['mac_allow'];
$all_mac_strings[] = $poolconf['mac_deny'];
......
......@@ -34,6 +34,10 @@ require_once("shaper.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1']))
$config['ipsec']['phase1'] = array();
......
......@@ -32,6 +32,10 @@ require_once("ipsec.inc");
require_once("vpn.inc");
require_once("filter.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['mobilekey'])) {
$config['ipsec']['mobilekey'] = array();
}
......
......@@ -31,6 +31,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['mobilekey'])) {
$config['ipsec']['mobilekey'] = array();
}
......
......@@ -31,6 +31,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1']))
$config['ipsec']['phase1'] = array();
......
......@@ -33,6 +33,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1']))
$config['ipsec']['phase1'] = array();
......
......@@ -32,6 +32,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['client']))
$config['ipsec']['client'] = array();
......
......@@ -33,6 +33,10 @@ require_once("shaper.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
$pconfig['noinstalllanspd'] = $config['system']['noinstalllanspd'];
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
foreach ($ipsec_loglevels as $lkey => $ldescr) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment