diff options
Diffstat (limited to 'etc/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 86916cf..ac8fa37 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -260,7 +260,7 @@ function system_hostname_configure() { return $status; } -function system_routing_configure() { +function system_routing_configure($interface = "") { global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); @@ -276,7 +276,7 @@ function system_routing_configure() { $interfacegw = ""; /* tack on all the hard defined gateways as well */ if (is_array($config['gateways']['gateway_item'])) { - mwexec("/bin/rm {$g['tmp_path']}/*_defaultgw"); + mwexec("/bin/rm {$g['tmp_path']}/*_defaultgw", true); $foundgw = false; foreach ($config['gateways']['gateway_item'] as $gateway) { if (isset($gateway['defaultgw'])) { @@ -322,8 +322,10 @@ function system_routing_configure() { $route_arr[$items[0]] = array($items[0], $items[1], $items[5]); } - if ($dont_add_route == false) { - if (($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) { + if ($dont_add_route == false ) { + if (!empty($interface) && $inteface != $interafegw) + ; + else if (($interfacegw <> "bgpd") && (is_ipaddr($gatewayip))) { $action = "add"; if(isset($route_arr['default'])) { $action = "change"; @@ -345,6 +347,8 @@ function system_routing_configure() { $gateways_arr = return_gateways_array(); foreach ($config['staticroutes']['route'] as $rtent) { + if (!empty($interface) && $interface != $rtent['interface']) + continue; $gatewayip = ""; if (isset($gateways_arr[$rtent['gateway']])) { $gatewayip = $gateways_arr[$rtent['gateway']]['gateway']; |