diff options
author | Ermal <eri@pfsense.org> | 2010-06-18 18:46:06 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-06-18 18:46:06 +0000 |
commit | 1ea67f2ef911e614c08c1b4804f35c64fdbed001 (patch) | |
tree | 4521d3688b89343acbb7f0871010a8b57e2713a2 | |
parent | 769e254ee1316fb5d4a9429a37f44b6d8955fe55 (diff) | |
download | pfsense-1ea67f2ef911e614c08c1b4804f35c64fdbed001.zip pfsense-1ea67f2ef911e614c08c1b4804f35c64fdbed001.tar.gz |
Also teach system_routing_configure to have an interface as parameter so to reload only routes related to this interface when an interface is reconfigured.
-rw-r--r-- | etc/inc/interfaces.inc | 2 | ||||
-rw-r--r-- | etc/inc/system.inc | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 52478f5..004f2b3 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -2355,7 +2355,7 @@ function interface_configure($interface = "wan", $reloadall = false) { if ($reloadall == true) { /* reconfigure static routes (kernel may have deleted them) */ - system_routing_configure(); + system_routing_configure($interface); /* reload ipsec tunnels */ vpn_ipsec_configure(); diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 9a0d054..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(); @@ -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']; |