Commit e8496219 authored by Franco Fichtner's avatar Franco Fichtner

src: fix crash reports

parent 3644a724
...@@ -382,14 +382,23 @@ function filter_generate_scrubing() { ...@@ -382,14 +382,23 @@ function filter_generate_scrubing() {
} }
/* disable scrub option */ /* disable scrub option */
foreach ($FilterIflist as $scrubif => $scrubcfg) { foreach ($FilterIflist as $scrubif => $scrubcfg) {
if(isset($scrubcfg['virtual']) || empty($scrubcfg['descr'])) if (isset($scrubcfg['virtual']) || empty($scrubcfg['descr'])) {
continue; continue;
}
/* set up MSS clamping */ /* set up MSS clamping */
if($scrubcfg['mss'] <> "" && is_numeric($scrubcfg['mss']) && isset($scrubcfg['if']) && $scrubcfg['if'] != "pppoe" && $scrubcfg['if'] != "pptp" && if (isset($scrubcfg['if'])) {
$scrubif['if'] != "l2tp") if (
$mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40)); $scrubcfg['mss'] != '' && is_numeric($scrubcfg['mss']) &&
else $scrubcfg['if'] != 'pppoe' && $scrubcfg['if'] != 'pptp' &&
$mssclamp = ""; $scrubif['if'] != 'l2tp'
) {
$mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40));
} else {
$mssclamp = '';
}
}
/* configure no-df for linux nfs and others */ /* configure no-df for linux nfs and others */
if(!empty($config['system']['scrubnodf'])) if(!empty($config['system']['scrubnodf']))
$scrubnodf = "no-df"; $scrubnodf = "no-df";
......
...@@ -87,10 +87,13 @@ $protos = array('icmp', 'icmp6', 'tcp', 'udp', 'arp', 'carp', 'esp', ...@@ -87,10 +87,13 @@ $protos = array('icmp', 'icmp6', 'tcp', 'udp', 'arp', 'carp', 'esp',
$input_errors = array(); $input_errors = array();
$interfaces = get_configured_interface_with_descr(); $interfaces = get_configured_interface_with_descr();
if (isset($config['ipsec']['enable']))
$interfaces['ipsec'] = "IPsec"; if (isset($config['ipsec']['enable'])) {
$interfaces['ipsec'] = 'IPsec';
}
foreach (array('server', 'client') as $mode) { foreach (array('server', 'client') as $mode) {
if (is_array($config['openvpn']["openvpn-{$mode}"])) { if (isset($config['openvpn']["openvpn-{$mode}"])) {
foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) {
if (!isset($setting['disable'])) { if (!isset($setting['disable'])) {
$interfaces['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']); $interfaces['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']);
......
...@@ -29,8 +29,9 @@ ...@@ -29,8 +29,9 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
if (!is_array($config['gifs']['gif'])) if (!isset($config['gifs']['gif'])) {
$config['gifs']['gif'] = array(); $config['gifs']['gif'] = array();
}
$a_gifs = &$config['gifs']['gif'] ; $a_gifs = &$config['gifs']['gif'] ;
......
...@@ -39,11 +39,11 @@ define("CRON_WEEKLY_PATTERN", "0 0 * * 0"); ...@@ -39,11 +39,11 @@ define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
define("CRON_DAILY_PATTERN", "0 0 * * *"); define("CRON_DAILY_PATTERN", "0 0 * * *");
define("CRON_HOURLY_PATTERN", "0 * * * *"); define("CRON_HOURLY_PATTERN", "0 * * * *");
if (!is_array($config['ppps'])) { if (!isset($config['ppps'])) {
$config['ppps'] = array(); $config['ppps'] = array();
} }
if (!is_array($config['ppps']['ppp'])) { if (!isset($config['ppps']['ppp'])) {
$config['ppps']['ppp'] = array(); $config['ppps']['ppp'] = array();
} }
...@@ -53,7 +53,7 @@ $iflist = get_configured_interface_with_descr(); ...@@ -53,7 +53,7 @@ $iflist = get_configured_interface_with_descr();
$portlist = get_interface_list(); $portlist = get_interface_list();
$portlist = array_merge($portlist, $iflist); $portlist = array_merge($portlist, $iflist);
if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) { foreach ($config['vlans']['vlan'] as $vlan) {
$portlist[$vlan['vlanif']] = $vlan; $portlist[$vlan['vlanif']] = $vlan;
} }
...@@ -156,8 +156,9 @@ if (isset($id) && $a_ppps[$id]) { ...@@ -156,8 +156,9 @@ if (isset($id) && $a_ppps[$id]) {
break; break;
} }
} else } else {
$pconfig['ptpid'] = interfaces_ptpid_next(); $pconfig['ptpid'] = interfaces_ptpid_next();
}
if ($_POST) { if ($_POST) {
...@@ -444,7 +445,10 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE" ...@@ -444,7 +445,10 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
</tr> </tr>
<tr style="display:none" name="portlists" id="portlists"> <tr style="display:none" name="portlists" id="portlists">
<td id="serialports"><?php <td id="serialports"><?php
$selected_ports = explode(',',$pconfig['interfaces']); $selected_ports = array();
if (isset($pconfig['interfaces'])) {
$selected_ports = explode(',',isset($pconfig['interfaces']));
}
if (!is_dir('/var/spool/lock')) { if (!is_dir('/var/spool/lock')) {
mwexec('/bin/mkdir -p /var/spool/lock'); mwexec('/bin/mkdir -p /var/spool/lock');
} }
......
...@@ -33,11 +33,16 @@ require_once("pfsense-utils.inc"); ...@@ -33,11 +33,16 @@ require_once("pfsense-utils.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$pconfig['enable'] = isset($config['dhcrelay']['enable']); $pconfig['enable'] = isset($config['dhcrelay']['enable']);
if (empty($config['dhcrelay']['interface'])) if (empty($config['dhcrelay']['interface'])) {
$pconfig['interface'] = array(); $pconfig['interface'] = array();
else } else {
$pconfig['interface'] = explode(",", $config['dhcrelay']['interface']); $pconfig['interface'] = explode(",", $config['dhcrelay']['interface']);
$pconfig['server'] = $config['dhcrelay']['server']; }
if (!isset($config['dhcrelay']['server'])) {
$pconfig['server'] = array();
} else {
$pconfig['server'] = $config['dhcrelay']['server'];
}
$pconfig['agentoption'] = isset($config['dhcrelay']['agentoption']); $pconfig['agentoption'] = isset($config['dhcrelay']['agentoption']);
$iflist = get_configured_interface_with_descr(); $iflist = get_configured_interface_with_descr();
......
...@@ -42,7 +42,7 @@ function is_dyndns_username($uname) { ...@@ -42,7 +42,7 @@ function is_dyndns_username($uname) {
return true; return true;
} }
if (!is_array($config['dyndnses']['dyndns'])) { if (!isset($config['dyndnses']['dyndns'])) {
$config['dyndnses']['dyndns'] = array(); $config['dyndnses']['dyndns'] = array();
} }
......
...@@ -36,7 +36,7 @@ require_once("openvpn-client-export.inc"); ...@@ -36,7 +36,7 @@ require_once("openvpn-client-export.inc");
$pgtitle = array("OpenVPN", "Client Export Utility"); $pgtitle = array("OpenVPN", "Client Export Utility");
if (!is_array($config['openvpn']['openvpn-server'])) { if (!isset($config['openvpn']['openvpn-server'])) {
$config['openvpn']['openvpn-server'] = array(); $config['openvpn']['openvpn-server'] = array();
} }
......
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