diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-05-05 23:47:55 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-05-05 23:47:55 +0000 |
commit | 6e17413e52521b685228039f6a7b5fb457254ad1 (patch) | |
tree | c2e3c6a72da76015bbd8d00fdb84deeaa803da5c /etc | |
parent | 83bc374960ab86911bb8d05d521ac94746c719ef (diff) | |
download | pfsense-6e17413e52521b685228039f6a7b5fb457254ad1.zip pfsense-6e17413e52521b685228039f6a7b5fb457254ad1.tar.gz |
Use exec_command instead of custom rolled function. Fix some logic here and there.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/system.inc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index c75de77..f05a3e9 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -225,8 +225,7 @@ function system_routing_configure() { if(isset($config['staticroutes']['enablefastrouting'])) mwexec("/sbin/sysctl net.inet.ip.fastforwarding=1"); - exec("/usr/bin/netstat -rn", $route_arr, $retval); - $route_str = implode("\n", $route_arr); + $route_str = exec_command("/usr/bin/netstat -rn"); /* clear out old routes, if necessary */ if (file_exists("{$g['vardb_path']}/routes.db")) { @@ -249,15 +248,19 @@ function system_routing_configure() { $dont_remove_route = false; foreach ($iflist as $ifent => $ifname) { + /* + * XXX: The value of this is really when this function can take + * an interface as parameter. + */ /* do not process interfaces that will end up with gateways */ - if (interface_has_gateway($ifent)) + if (interface_has_gateway($ifent) || + $config['interfaces'][$ifent]['ipaddr'] == "carpdev-dhcp") { $dont_remove_route = true; + break; + } } - if($config['interfaces']['wan']['ipaddr'] == "carpdev-dhcp") - $dont_remove_route = true; - - if($dont_remove_route == false) { + if ($dont_remove_route == false) { /* remove default route */ mwexec("/sbin/route delete default", true); } @@ -268,6 +271,7 @@ function system_routing_configure() { foreach($config['installedpackages']['olsrd']['config'] as $olsrd) { if($olsrd['enabledyngw'] == "on") { $dont_add_route = true; + break; } } } |