diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-03-05 14:56:34 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-03-05 14:56:34 +0000 |
commit | 5db1136645d05309043ac889b0fc6895c1e722f0 (patch) | |
tree | 61292c74e0d03aab31d1101292aeffb5e27fc5c5 /usr/local/pkg | |
parent | ba8ec11217a7ace9f905bfcd68cc17df40e38bbb (diff) | |
download | pfsense-5db1136645d05309043ac889b0fc6895c1e722f0.zip pfsense-5db1136645d05309043ac889b0fc6895c1e722f0.tar.gz |
Fix RIP code to be compliant with 2.0.
Diffstat (limited to 'usr/local/pkg')
-rw-r--r-- | usr/local/pkg/routed/routed.inc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/usr/local/pkg/routed/routed.inc b/usr/local/pkg/routed/routed.inc index de94fb4..2d4f6d1 100644 --- a/usr/local/pkg/routed/routed.inc +++ b/usr/local/pkg/routed/routed.inc @@ -39,28 +39,25 @@ function setup_routed() { if (isset($config['installedpackages']['routed']['config'][0]['enable']) && $config['installedpackages']['routed']['config'][0]['enable'] == "on") { /* if user selected individual interfaces */ - $ifdescrs = array ("wan", "lan"); - for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { - if(isset($config['interfaces']['opt' . $j]['enable'])) - $ifdescrs['opt' . $j] = "opt" . $j; - } - + $ifdescrs = get_configured_interface_with_descr(); $ifarr = explode(",", $config['installedpackages']['routed']['config'][0]['iface_array']); if (count($ifarr) != 0) { foreach($ifdescrs as $ifdescr => $ifname) { if (in_array($ifname, $ifarr)) { - $gw .= setup_etc_gateways($ifname, 'enable'); + $gw .= setup_etc_gateways($ifdescr, 'enable'); } else { - $gw .= setup_etc_gateways($ifname, 'disable'); + $gw .= setup_etc_gateways($ifdescr, 'disable'); } } } else { /* setup for all interfaces */ $gw = setup_etc_gateways(); } + conf_mount_rw(); $fd = fopen("/etc/gateways", "w"); fwrite($fd, $gw); fclose($fd); + conf_mount_ro(); restart_routed(); } else { stop_routed(); @@ -70,9 +67,11 @@ function setup_routed() { function setup_etc_gateways($iface="", $mode="") { global $config; + $ret = ""; if ($iface != "") { - $realif=convert_friendly_interface_to_real_interface_name(strtoupper($iface)); - $ret = "if={$realif} "; + $realif=convert_friendly_interface_to_real_interface_name($iface); + if ($realif) + $ret = "if={$realif} "; } switch($mode) { |