Filter rules for interface-subnet rules fixed.

This commit is contained in:
Eirik Oeverby 2009-09-23 23:04:51 +02:00
parent 685c1413ba
commit f65c2f4c42

View File

@ -1127,14 +1127,14 @@ function filter_generate_address(& $rule, $target = "source")
if (strstr($rule[$target]['network'], "opt")) {
$optmatch = "";
$matches = "";
if (preg_match("/opt([0-9999])/", $rule[$target]['network'], $optmatch)) {
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-9999])ip/", $rule[$target]['network'], $matches)) {
} else if (preg_match("/opt([0-9]*)ip/", $rule[$target]['network'], $matches)) {
$src = $FilterIflist["opt{$matches[1]}"]['ip'];
if (!is_ipaddr($src))
return "";
@ -1393,7 +1393,9 @@ function filter_generate_user_rule($rule)
/* destination address */
$dst = filter_generate_address($rule, "destination");
if (empty($dst) || ($dst == "/")) {
global $FilterIflist;
file_put_contents('/tmp/rule_dst.array', print_r($rule, 1));
file_put_contents('/tmp/filterIflist.dmp', print_r($FilterIflist, 1));
return "# returning at dst $dst == \"/\"";
}
$aline['dst'] = "to $dst ";