diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-12-18 16:01:32 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-12-18 16:01:32 +0100 |
commit | fc85edafe116bbb5fb7c3550d42f5b39f153bf6b (patch) | |
tree | 8c90e2492f8cecda46a7b2539124548705c7fd95 | |
parent | 137ea11c2715bb756da2a539bc38d62113fa02da (diff) | |
download | pfsense-fc85edafe116bbb5fb7c3550d42f5b39f153bf6b.zip pfsense-fc85edafe116bbb5fb7c3550d42f5b39f153bf6b.tar.gz |
Replace the previous itteration with this version 2 attempt.
The interface gateways array previously contained no interface name that could be used.
Succesfully upgraded 1 configuration. Needs more testing to catch other edge cases.
-rw-r--r-- | etc/inc/upgrade_config.inc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 6349d40..b39afa3 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -756,17 +756,19 @@ function upgrade_041_to_042() { function upgrade_042_to_043() { global $config; /* migrate old interface gateway to the new gateways config */ - $old_gateways = array(); + $iflist = get_configured_interface_list(); $gateways = array(); $i = 0; - $old_gateways = get_interfaces_with_gateway(); - foreach($old_gateways as $ifname => $interface) { + foreach($iflist as $ifname => $interface) { + if(! interface_has_gateway($ifname)) { + continue; + } if(is_ipaddr($config['interfaces'][$ifname]['gateway'])) { $config['gateways']['gateway_item'][$i]['gateway'] = $config['interfaces'][$ifname]['gateway']; $config['gateways']['gateway_item'][$i]['interface'] = $ifname; - $config['gateways']['gateway_item'][$i]['name'] = $ifname ."_GW"; + $config['gateways']['gateway_item'][$i]['name'] = strtoupper($ifname) ."_GW"; if(is_ipaddr($config['interfaces'][$ifname]['use_rrd_gateway'])) { - $config['gateways']['gateway_item'}[$i]['monitor'] = $config['interfaces'][$ifname]['use_rrd_gateway']; + $config['gateways']['gateway_item'][$i]['monitor'] = $config['interfaces'][$ifname]['use_rrd_gateway']; unset($config['interfaces'][$ifname]['use_rrd_gateway']); } $config['interfaces'][$ifname]['gateway'] = $config['gateways']['gateway_item'][$i]['name']; |