diff options
author | Chris Buechler <cmb@pfsense.org> | 2016-01-29 01:57:05 -0600 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-01-29 01:57:05 -0600 |
commit | 1968fe40272e9f90b44dd033f93a44a22d26198e (patch) | |
tree | 70457f3c202af9a253970d2001ba253c34ab78a2 /src/etc/inc/upgrade_config.inc | |
parent | 0d14e2ac8ee6519d379c5e9bf5e2908c3ff0bcc2 (diff) | |
download | pfsense-1968fe40272e9f90b44dd033f93a44a22d26198e.zip pfsense-1968fe40272e9f90b44dd033f93a44a22d26198e.tar.gz |
Make sure filter rules have a tracker ID, associated rules were missing it previously.
Diffstat (limited to 'src/etc/inc/upgrade_config.inc')
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index 7174ca6..9e356e3 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -4355,7 +4355,7 @@ function upgrade_140_to_141() { global $config; // retain OpenVPN's net30 default topology for upgraded configs so they still work - if (is_array($config['openvpn']['openvpn-server'])) { + if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-server'])) { foreach ($config['openvpn']['openvpn-server'] as $idx => $ovpnserver) { if (!isset($ovpnserver['topology'])) { $config['openvpn']['openvpn-server'][$idx]['topology'] = "net30"; @@ -4363,13 +4363,26 @@ function upgrade_140_to_141() { } } - if (is_array($config['openvpn']['openvpn-client'])) { + if (is_array($config['openvpn']) && is_array($config['openvpn']['openvpn-client'])) { foreach ($config['openvpn']['openvpn-client'] as $idx => $ovpnclient) { if (!isset($ovpnclient['topology'])) { $config['openvpn']['openvpn-client'][$idx]['topology'] = "net30"; } } } + + // repeat addition of filter tracker IDs from 106_to_107 where missing since associated filter rules were missing them + if (is_array($config['filter']) && is_array($config['filter']['rule'])) { + $tracker = (int)microtime(true); + foreach ($config['filter']['rule'] as $ridx => $rule) { + if (empty($rule['tracker'])) { + $config['filter']['rule'][$ridx]['tracker'] = $tracker; + $tracker++; + } + } + unset($tracker, $ridx); + } + } ?> |