summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/openvpn.attributes.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-11-15 17:44:38 +0545
committerPhil Davis <phil.davis@inf.org>2015-11-15 17:44:38 +0545
commitb0ccc67bbde483714937256828326392a61b08d3 (patch)
tree70e135237c6f25079dadce22ce2ec1331d8bf5c1 /src/etc/inc/openvpn.attributes.php
parent8e81f6a88180c5c9a280d78fd77788f7160b0d1a (diff)
downloadpfsense-b0ccc67bbde483714937256828326392a61b08d3.zip
pfsense-b0ccc67bbde483714937256828326392a61b08d3.tar.gz
Alternate way to correct rules for ticket #5451
The code here build up each clause in $tmprule and always adds a space at the end of the clause, in case there is another clause to come. The only place that did not do this was "from any" at line 131. Fixing that should fix the issue and keep it all consistent. There should be no need to add a space before all of the "to..." clauses. Actually the first fix by @cbuechler https://github.com/pfsense/pfsense/commit/8e81f6a88180c5c9a280d78fd77788f7160b0d1a will work fine, but IMHO this is a little cleaner and will be easier for future maintainers to understand.
Diffstat (limited to 'src/etc/inc/openvpn.attributes.php')
-rw-r--r--src/etc/inc/openvpn.attributes.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/etc/inc/openvpn.attributes.php b/src/etc/inc/openvpn.attributes.php
index b966448..4da9f0d 100644
--- a/src/etc/inc/openvpn.attributes.php
+++ b/src/etc/inc/openvpn.attributes.php
@@ -128,7 +128,7 @@ function parse_cisco_acl($attribs) {
$isblock = false;
}
} else if (trim($rule[$index]) == "any") {
- $tmprule .= "from any";
+ $tmprule .= "from any ";
$index++;
} else {
$tmprule .= "from {$rule[$index]}";
@@ -143,16 +143,16 @@ function parse_cisco_acl($attribs) {
/* Destination */
if (trim($rule[$index]) == "host") {
$index++;
- $tmprule .= " to {$rule[$index]} ";
+ $tmprule .= "to {$rule[$index]} ";
$index++;
if ($isblock == true) {
$isblock = false;
}
} else if (trim($rule[$index]) == "any") {
$index++;
- $tmprule .= " to any";
+ $tmprule .= "to any";
} else {
- $tmprule .= " to {$rule[$index]}";
+ $tmprule .= "to {$rule[$index]}";
$index++;
$netmask = cisco_to_cidr($rule[$index]);
$tmprule .= "/{$netmask} ";
OpenPOWER on IntegriCloud