Add entries for optional interfaces ip address

Ticket #1041
This commit is contained in:
Scott Ullrich 2006-07-08 19:14:48 +00:00
parent ec0249eccb
commit cbff71a1e1
2 changed files with 17 additions and 0 deletions

View File

@ -1334,6 +1334,13 @@ function generate_user_filter_rule($rule, $ngcounter) {
$src = "{$pppoesa}/{$pppoesn}";
break;
}
/* check for opt$NUMip here */
$matches = "";
if (preg_match("/opt([0-9999])ip/", $rule['source']['network'], $matches)) {
$optnum = $matches[0];
$real_int = convert_friendly_interface_to_real_interface_name("opt{$optnum}");
$dst = find_interface_ip($real_int);
}
if (isset($rule['source']['not'])) $src = "!{$src}";
}
} else if ($rule['source']['address']) {
@ -1426,6 +1433,13 @@ function generate_user_filter_rule($rule, $ngcounter) {
$dst = "{$ppoesa}/{$pppoesn}";
break;
}
/* check for opt$NUMip here */
$matches = "";
if (preg_match("/opt([0-9999])ip/", $rule['destination']['network'], $matches)) {
$optnum = $matches[0];
$real_int = convert_friendly_interface_to_real_interface_name("opt{$optnum}");
$dst = find_interface_ip($real_int);
}
if (isset($rule['destination']['not'])) $dst = " !{$dst}";
}
} else if ($rule['destination']['address']) {

View File

@ -567,6 +567,9 @@ include("head.inc");
<option value="pppoe" <?php if ($pconfig['dst'] == "pppoe") { echo "selected"; } ?>>PPPoE clients</option>
<?php for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++): ?>
<option value="opt<?=$i;?>" <?php if ($pconfig['dst'] == "opt" . $i) { echo "selected"; } ?>><?=htmlspecialchars($config['interfaces']['opt' . $i]['descr']);?> subnet</option>
<option value="opt<?=$i;?>ip"<?php if ($pconfig['src'] == "opt" . $i . "ip") { echo "selected"; } ?>>
<?=$config['interfaces']['opt' . $i]['descr']?> address
</option>
<?php endfor; ?>
</select>
</td>