From c0f5182ce0b30aa61b02df3dbe3d45fcda0961db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 9 Mar 2010 20:34:51 +0000 Subject: 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. --- etc/inc/interfaces.inc | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'etc/inc/interfaces.inc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index d86b20e..c31e259 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2034,7 +2034,20 @@ EOD; set iface name {$realif} EOD; - if ($interface == "wan") + $setdefaultgw = false; + $founddefaultgw = false; + if (is_array($config['gateways']['gateway_item'])) { + foreach($config['gateways']['gateway_item'] as $gateway) { + if($interface == $gateway['interface'] && isset($gateway['defaultgw'])) { + $setdefaultgw = true; + break; + } else if (isset($gateway['defaultgw'])) { + $founddefaultgw = true; + break; + } + } + } + if (($interface == "wan" && $founddefaultgw == false) || $setdefaultgw == true) $mpdconf .= <<