summaryrefslogtreecommitdiffstats
path: root/etc/inc/upgrade_config.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-01-05 12:08:39 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-01-05 12:13:55 -0200
commite99ba2d66e915904626fd90ecc87711169189bdc (patch)
treef8f5365492cf5d47df27236887b7365e186a080d /etc/inc/upgrade_config.inc
parentaca65de524027e9aedfa38f83665907b41abce58 (diff)
downloadpfsense-e99ba2d66e915904626fd90ecc87711169189bdc.zip
pfsense-e99ba2d66e915904626fd90ecc87711169189bdc.tar.gz
Fix outbound NAT rules when interface is deleted:
- When delete interface, do not touch outbound NAT rules - Skip outbound NAT rules when interface doesn't exist - Bump latest_config to 9.2 - Since rules with no interface were considered as wan, convert old rules adding interface 'wan' to avoid breaking old configs It should fix #2338
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r--etc/inc/upgrade_config.inc13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 4ddb7f1..216ce2c 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -2965,4 +2965,17 @@ function upgrade_090_to_091() {
}
}
}
+
+function upgrade_091_to_092() {
+ global $config;
+
+ if (is_array($config['nat']['advancedoutbound']) && is_array($config['nat']['advancedoutbound']['rule'])) {
+ $nat_rules = &$config['nat']['advancedoutbound']['rule'];
+ for ($i = 0; isset($nat_rules[$i]); $i++) {
+ if (empty($nat_rules[$i]['interface'])) {
+ $nat_rules[$i]['interface'] = 'wan';
+ }
+ }
+ }
+}
?>
OpenPOWER on IntegriCloud