Commit 546a7157 authored by Franco Fichtner's avatar Franco Fichtner

gateways: better fix for previous, tunnel handling is magic

parent c0c56778
...@@ -602,7 +602,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -602,7 +602,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
continue; continue;
} }
if (empty($ifcfg['ipaddr']) || is_ipaddrv4($ifcfg['ipaddr'])) { if (!empty($ifcfg['ipaddr']) && is_ipaddrv4($ifcfg['ipaddr'])) {
continue; continue;
} }
...@@ -610,13 +610,13 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -610,13 +610,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") {
...@@ -629,6 +629,11 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -629,6 +629,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();
...@@ -688,7 +693,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -688,7 +693,7 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive
continue; continue;
} }
if (empty($ifcfg['ipaddrv6']) || is_ipaddrv6($ifcfg['ipaddrv6'])) { if (!empty($ifcfg['ipaddrv6']) && is_ipaddrv6($ifcfg['ipaddrv6'])) {
continue; continue;
} }
...@@ -696,13 +701,13 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -696,13 +701,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);
...@@ -718,6 +723,11 @@ function return_gateways_array($disabled = false, $localhost = false, $inactive ...@@ -718,6 +723,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