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