summaryrefslogtreecommitdiffstats
path: root/etc/inc/system.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-03-09 20:34:51 +0000
committerErmal Luçi <eri@pfsense.org>2010-03-09 20:34:51 +0000
commitc0f5182ce0b30aa61b02df3dbe3d45fcda0961db (patch)
tree37ee9ac0d51d86b3540ef9eda885766dd75b18fe /etc/inc/system.inc
parent68ff67b360068bf308eb0305aeb1fa841f85bc01 (diff)
downloadpfsense-c0f5182ce0b30aa61b02df3dbe3d45fcda0961db.zip
pfsense-c0f5182ce0b30aa61b02df3dbe3d45fcda0961db.tar.gz
Correctly configure the default route addition when interfaces are configured for pppoe/pptp. Handle in system routing configure dynamic interfaces. Also when chaning or configuring the defaultgw reconfigure the underlying interface, this helps when this interfaces are dynamics one.
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r--etc/inc/system.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 4f194be..c5329f2 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -314,6 +314,10 @@ function system_routing_configure() {
if(isset($gateway['defaultgw'])) {
$gatewayip = $gateway['gateway'];
$interfacegw = $gateway['interface'];
+ /* This handles the case where a dynamic gateway is choosen as default. */
+ if (!is_ipaddr($gatewayip))
+ $gatewayip = get_interface_gateway($interfacegw);
+ break;
}
}
if(($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) {
@@ -353,13 +357,17 @@ function system_routing_configure() {
if($rtent['gateway'] == $gateway['name']) {
$gatewayip = $gateway['gateway'];
$interfacegw = $gateway['interface'];
+ /* This handles the case where a dynamic gateway is choosen. */
+ if (!is_ipaddr($gatewayip))
+ $gatewayip = get_interface_gateway($interfacegw);
+ break;
}
}
}
- if((is_ipaddr($rtent['gateway'])) && ($gatewayip == "")) {
+ if((is_ipaddr($rtent['gateway'])) && empty($gatewayip)) {
$gatewayip = $rtent['gateway'];
$interfacegw = $rtent['interface'];
- }
+ }
if((isset($rtent['interfacegateway'])) && (! is_ipaddr($gatewayip))) {
mwexec("/sbin/route add " . escapeshellarg($rtent['network']) .
" -iface " . escapeshellarg(convert_friendly_interface_to_real_interface_name($interfacegw)));
OpenPOWER on IntegriCloud