summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-06 20:50:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-06 20:50:55 +0000
commit00fd52b921084841ff396b471769124b996531d5 (patch)
tree2b1e5c1e6b84ef6d903fa52f39a7da4a08ea4f53 /etc
parent0311dbd53670b32017229b3ccb74f55e6aba52e4 (diff)
downloadpfsense-00fd52b921084841ff396b471769124b996531d5.zip
pfsense-00fd52b921084841ff396b471769124b996531d5.tar.gz
Detect /tmp/{$rule['if']}_router and use it
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc14
1 files changed, 12 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 21e7894..bd60b92 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1210,14 +1210,24 @@ function generate_user_filter_rule($rule, $ngcounter) {
$line .= "on \$" . $interface . " ";
}
- $rg = $config['interfaces'][$rule['interface']]['gateway'];
+ /* set the gateway for this item if its defined */
+ if($config['interfaces'][$rule['interface']]['gateway'] <> "")
+ $rg = $config['interfaces'][$rule['interface']]['gateway'];
$ri = filter_translate_type_to_real_interface($rule['interface']);
+
+ /*
+ * check to see if /tmp/{$rule['if']}_router exists. This file
+ * is created by dhclient for 2nd wan interfaces, etc.
+ */
+ if(file_exists("/tmp/{$rule['if']}_router"))
+ $rg = return_filename_as_string("/tmp/{$rule['if']}_router"));
+
if($rg <> "" and $ri <> "" and stristr($rule['interface'],"opt") == true) {
$line .= "reply-to (" . $ri . " " . $rg . ") ";
}
/* if user has selected a custom gateway, lets work with it */
- if($rule['gateway'] <> "") {
+ if($rg <> "") {
$int = guess_interface_from_ip($rule['gateway']);
$line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
}
OpenPOWER on IntegriCloud