Project

General

Profile

« Previous | Next » 

Revision 02203e6d

Added by Renato Botelho about 12 years ago

Fix IPv6 Prefix ID default value

. Always initialize it to 0 when it's undefined
. Remove unecessary initializations and checks
. Bump config version to 9.5
. Write an upgrade config function to initialize old configs properly

View differences:

etc/inc/upgrade_config.inc
3074 3074
	}
3075 3075
}
3076 3076

  
3077
function upgrade_094_to_095() {
3078
	global $config;
3079

  
3080
	if (!isset($config['interfaces']) || !is_array($config['interfaces']))
3081
		return;
3082

  
3083
	foreach ($config['interfaces'] as $iface => $cfg)
3084
		if (isset($cfg['ipaddrv6']) && ($cfg['ipaddrv6'] == "track6"))
3085
			if (!isset($cfg['track6-prefix-id']) || ($cfg['track6-prefix-id'] == ""))
3086
				$config['interfaces'][$iface]['track6-prefix-id'] = 0;
3087
}
3088

  
3077 3089
?>

Also available in: Unified diff