Commit ffd39667 authored by Ad Schellevis's avatar Ad Schellevis

Revert "fix prev."

This reverts commit 88580477.
parent 88580477
...@@ -1150,10 +1150,12 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal ...@@ -1150,10 +1150,12 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal
} }
/* PPPoE subnet */ /* PPPoE subnet */
foreach (array($FilterIflist['pppoe']['items']) as $pppoe) { if (isset($FilterIflist['pppoe']['items']) && is_array($FilterIflist['pppoe']['items'])) {
if (is_private_ip($pppoe['ip'])) { foreach ($FilterIflist['pppoe']['items'] as $pppoe) {
$tonathosts[] = "{$pppoe['sa']}/{$pppoe['sn']}"; if (is_private_ip($pppoe['ip'])) {
$descriptions[] = gettext("PPPoE server"); $tonathosts[] = "{$pppoe['sa']}/{$pppoe['sn']}";
$descriptions[] = gettext("PPPoE server");
}
} }
} }
...@@ -1168,17 +1170,21 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal ...@@ -1168,17 +1170,21 @@ function filter_nat_rules_automatic_tonathosts(&$FilterIflist, $with_descr = fal
} }
/* add openvpn interfaces */ /* add openvpn interfaces */
foreach (array($config['openvpn']['openvpn-server']) as $ovpnsrv) { if (isset($config['openvpn']['openvpn-server'])) {
if (!isset($ovpnsrv['disable']) && !empty($ovpnsrv['tunnel_network'])) { foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
$tonathosts[] = $ovpnsrv['tunnel_network']; if (!isset($ovpnsrv['disable']) && !empty($ovpnsrv['tunnel_network'])) {
$descriptions[] = gettext("OpenVPN server"); $tonathosts[] = $ovpnsrv['tunnel_network'];
$descriptions[] = gettext("OpenVPN server");
}
} }
} }
foreach (array($config['openvpn']['openvpn-client']) as $ovpncli) { if (isset($config['openvpn']['openvpn-client'])) {
if (!isset($ovpncli['disable']) && !empty($ovpncli['tunnel_network'])) { foreach ($config['openvpn']['openvpn-client'] as $ovpncli) {
$tonathosts[] = $ovpncli['tunnel_network']; if (!isset($ovpncli['disable']) && !empty($ovpncli['tunnel_network'])) {
$descriptions[] = gettext("OpenVPN client"); $tonathosts[] = $ovpncli['tunnel_network'];
$descriptions[] = gettext("OpenVPN client");
}
} }
} }
......
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