Commit c3a711c0 authored by Franco Fichtner's avatar Franco Fichtner

gataways: empty ipaddr means there is no gateway; closes #933

(cherry picked from commit c0c56778)
(cherry picked from commit 546a7157)
parent 0af55508
...@@ -607,13 +607,13 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -607,13 +607,13 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
continue; continue;
} }
$ctype = ""; $ctype = '';
switch($ifcfg['ipaddr']) { switch($ifcfg['ipaddr']) {
case "dhcp": case "dhcp":
case "pppoe": case "pppoe":
case "pptp": case "pptp":
case "ppp": case "ppp":
$ctype = strtoupper($ifcfg['ipaddr']); $ctype = $ifcfg['ipaddr'];
break; break;
default: default:
if (substr($ifcfg['if'], 0, 4) == "ovpn") { if (substr($ifcfg['if'], 0, 4) == "ovpn") {
...@@ -626,6 +626,11 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -626,6 +626,11 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
} }
break; break;
} }
if (empty($ctype)) {
continue;
}
$ctype = "_". strtoupper($ctype); $ctype = "_". strtoupper($ctype);
$gateway = array(); $gateway = array();
...@@ -693,13 +698,13 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -693,13 +698,13 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
continue; continue;
} }
$ctype = ""; $ctype = '';
switch($ifcfg['ipaddrv6']) { switch($ifcfg['ipaddrv6']) {
case "slaac": case "slaac":
case "dhcp6": case "dhcp6":
case "6to4": case "6to4":
case "6rd": case "6rd":
$ctype = strtoupper($ifcfg['ipaddrv6']); $ctype = $ifcfg['ipaddrv6'];
break; break;
default: default:
$tunnelif = substr($ifcfg['if'], 0, 3); $tunnelif = substr($ifcfg['if'], 0, 3);
...@@ -715,6 +720,11 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -715,6 +720,11 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
} }
break; break;
} }
if (empty($ctype)) {
continue;
}
$ctype = "_". strtoupper($ctype); $ctype = "_". strtoupper($ctype);
$gateway = array(); $gateway = 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