Commit 88580477 authored by Ad Schellevis's avatar Ad Schellevis

fix prev.

parent 7a80b2eb
...@@ -1150,14 +1150,12 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal ...@@ -1150,14 +1150,12 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal
} }
/* PPPoE subnet */ /* PPPoE subnet */
if (isset($FilterIflist['pppoe']['items']) && is_array($FilterIflist['pppoe']['items'])) { foreach (array($FilterIflist['pppoe']['items']) as $pppoe) {
foreach ($FilterIflist['pppoe']['items'] as $pppoe) {
if (is_private_ip($pppoe['ip'])) { if (is_private_ip($pppoe['ip'])) {
$tonathosts[] = "{$pppoe['sa']}/{$pppoe['sn']}"; $tonathosts[] = "{$pppoe['sa']}/{$pppoe['sn']}";
$descriptions[] = gettext("PPPoE server"); $descriptions[] = gettext("PPPoE server");
} }
} }
}
/* L2TP subnet */ /* L2TP subnet */
if (isset($FilterIflist['l2tp']) && $FilterIflist['l2tp']['mode'] == "server") { if (isset($FilterIflist['l2tp']) && $FilterIflist['l2tp']['mode'] == "server") {
...@@ -1170,23 +1168,19 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal ...@@ -1170,23 +1168,19 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal
} }
/* add openvpn interfaces */ /* add openvpn interfaces */
if (isset($config['openvpn']['openvpn-server'])) { foreach (array($config['openvpn']['openvpn-server']) as $ovpnsrv) {
foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
if (!isset($ovpnsrv['disable']) && !empty($ovpnsrv['tunnel_network'])) { if (!isset($ovpnsrv['disable']) && !empty($ovpnsrv['tunnel_network'])) {
$tonathosts[] = $ovpnsrv['tunnel_network']; $tonathosts[] = $ovpnsrv['tunnel_network'];
$descriptions[] = gettext("OpenVPN server"); $descriptions[] = gettext("OpenVPN server");
} }
} }
}
if (isset($config['openvpn']['openvpn-client'])) { foreach (array($config['openvpn']['openvpn-client']) as $ovpncli) {
foreach ($config['openvpn']['openvpn-client'] as $ovpncli) {
if (!isset($ovpncli['disable']) && !empty($ovpncli['tunnel_network'])) { if (!isset($ovpncli['disable']) && !empty($ovpncli['tunnel_network'])) {
$tonathosts[] = $ovpncli['tunnel_network']; $tonathosts[] = $ovpncli['tunnel_network'];
$descriptions[] = gettext("OpenVPN client"); $descriptions[] = gettext("OpenVPN client");
} }
} }
}
/* IPsec mode_cfg subnet */ /* IPsec mode_cfg subnet */
if (isset($config['ipsec']['client']['enable']) && if (isset($config['ipsec']['client']['enable']) &&
......
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