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) ...@@ -5241,7 +5241,9 @@ function interfaces_staticarp_configure($if)
if (is_array($config['dhcpd'][$if]['staticmap'])) { if (is_array($config['dhcpd'][$if]['staticmap'])) {
foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) { foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
if (isset($arpent['ipaddr'])) {
mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac'])); mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
}
} }
...@@ -5252,11 +5254,13 @@ function interfaces_staticarp_configure($if) ...@@ -5252,11 +5254,13 @@ function interfaces_staticarp_configure($if)
if (isset($config['dhcpd'][$if]['staticmap'])) { if (isset($config['dhcpd'][$if]['staticmap'])) {
foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) { foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
if (isset($arpent['arp_table_static_entry'])) { if (isset($arpent['arp_table_static_entry'])) {
if (isset($arpent['ipaddr'])) {
mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac'])); mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
} }
} }
} }
} }
}
return 0; return 0;
} }
......
...@@ -496,7 +496,7 @@ EOPP; ...@@ -496,7 +496,7 @@ EOPP;
$all_pools = array(); $all_pools = array();
$all_pools[] = $dhcpifconf; $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']); $all_pools = array_merge($all_pools, $dhcpifconf['pool']);
} }
...@@ -546,7 +546,7 @@ EOPP; ...@@ -546,7 +546,7 @@ EOPP;
/* Create classes - These all contain comma separated lists. Join them into one /* Create classes - These all contain comma separated lists. Join them into one
big comma separated string then split them all up. */ big comma separated string then split them all up. */
$all_mac_strings = array(); $all_mac_strings = array();
if (is_array($dhcpifconf['pool'])) { if (is_array($dhcpifconf['pool']) && isset($dhcpifconf['pool']['range']) ) {
foreach($all_pools as $poolconf) { foreach($all_pools as $poolconf) {
$all_mac_strings[] = $poolconf['mac_allow']; $all_mac_strings[] = $poolconf['mac_allow'];
$all_mac_strings[] = $poolconf['mac_deny']; $all_mac_strings[] = $poolconf['mac_deny'];
......
...@@ -34,6 +34,10 @@ require_once("shaper.inc"); ...@@ -34,6 +34,10 @@ require_once("shaper.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec']['phase1']))
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
......
...@@ -32,6 +32,10 @@ require_once("ipsec.inc"); ...@@ -32,6 +32,10 @@ require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
require_once("filter.inc"); require_once("filter.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['mobilekey'])) { if (!is_array($config['ipsec']['mobilekey'])) {
$config['ipsec']['mobilekey'] = array(); $config['ipsec']['mobilekey'] = array();
} }
......
...@@ -31,6 +31,10 @@ require_once("guiconfig.inc"); ...@@ -31,6 +31,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['mobilekey'])) { if (!is_array($config['ipsec']['mobilekey'])) {
$config['ipsec']['mobilekey'] = array(); $config['ipsec']['mobilekey'] = array();
} }
......
...@@ -31,6 +31,10 @@ require_once("guiconfig.inc"); ...@@ -31,6 +31,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec']['phase1']))
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
......
...@@ -33,6 +33,10 @@ require_once("guiconfig.inc"); ...@@ -33,6 +33,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['phase1'])) if (!is_array($config['ipsec']['phase1']))
$config['ipsec']['phase1'] = array(); $config['ipsec']['phase1'] = array();
......
...@@ -32,6 +32,10 @@ require_once("guiconfig.inc"); ...@@ -32,6 +32,10 @@ require_once("guiconfig.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
if (!is_array($config['ipsec']['client'])) if (!is_array($config['ipsec']['client']))
$config['ipsec']['client'] = array(); $config['ipsec']['client'] = array();
......
...@@ -33,6 +33,10 @@ require_once("shaper.inc"); ...@@ -33,6 +33,10 @@ require_once("shaper.inc");
require_once("ipsec.inc"); require_once("ipsec.inc");
require_once("vpn.inc"); require_once("vpn.inc");
if (!is_array($config['ipsec'])) {
$config['ipsec'] = array();
}
$pconfig['noinstalllanspd'] = $config['system']['noinstalllanspd']; $pconfig['noinstalllanspd'] = $config['system']['noinstalllanspd'];
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']); $pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
foreach ($ipsec_loglevels as $lkey => $ldescr) { 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