summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc15
1 files changed, 8 insertions, 7 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 01e37ce..2e53607 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1510,17 +1510,17 @@ function filter_generate_address(& $rule, $target = "source", $isnat = false) {
if(strstr($rule[$target]['network'], "opt")) {
$optmatch = "";
$matches = "";
- if(preg_match("/opt([0-9]*)$/", $rule[$target]['network'], $optmatch)) {
+ /* check for opt$NUMip here */
+ if (preg_match("/opt([0-9]*)ip/", $rule[$target]['network'], $matches)) {
+ $src = $FilterIflist["opt{$matches[1]}"]['ip'];
+ if(!is_ipaddr($src))
+ return "";
+ } else if (preg_match("/opt([0-9]*)$/", $rule[$target]['network'], $optmatch)) {
$opt_ip = $FilterIflist["opt{$optmatch[1]}"]['ip'];
if(!is_ipaddr($opt_ip))
return "";
$src = $opt_ip . "/" .
$FilterIflist["opt{$optmatch[1]}"]['sn'];
- /* check for opt$NUMip here */
- } else if(preg_match("/opt([0-9]*)ip/", $rule[$target]['network'], $matches)) {
- $src = $FilterIflist["opt{$matches[1]}"]['ip'];
- if(!is_ipaddr($src))
- return "";
}
if(isset($rule[$target]['not']))
$src = " !{$src}";
@@ -1553,7 +1553,8 @@ function filter_generate_address(& $rule, $target = "source", $isnat = false) {
$src = "{$pppoesa}/{$pppoesn}";
break;
}
- if(isset($rule[$target]['not'])) $src = "!{$src}";
+ if(isset($rule[$target]['not']))
+ $src = "!{$src}";
}
} else if($rule[$target]['address']) {
$expsrc = alias_expand($rule[$target]['address']);
OpenPOWER on IntegriCloud