summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-08-15 13:45:09 -0400
committerjim-p <jimp@pfsense.org>2013-08-15 13:46:45 -0400
commit108e868d70ab8d0ff546f93c98d5ccd1110bd295 (patch)
tree3f6e682c524422886ba96df5ec57f5c9a540feff /usr/local
parentc0fc63d15abd3cff89f4081934d090813c00d8c6 (diff)
downloadpfsense-108e868d70ab8d0ff546f93c98d5ccd1110bd295.zip
pfsense-108e868d70ab8d0ff546f93c98d5ccd1110bd295.tar.gz
When renaming or deleting a virtual server, clean up the old relayd anchor name. Otherwise the rules are still there and valid, and will cause problems as they will override the new VS settings. Also clear out the anchors when stopping relayd or starting fresh that way no old settings could conflict.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/load_balancer_virtual_server.php3
-rwxr-xr-xusr/local/www/load_balancer_virtual_server_edit.php8
2 files changed, 9 insertions, 2 deletions
diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php
index 3ae600a..023bbd4 100755
--- a/usr/local/www/load_balancer_virtual_server.php
+++ b/usr/local/www/load_balancer_virtual_server.php
@@ -58,6 +58,8 @@ if ($_POST) {
$retval |= filter_configure();
$retval |= relayd_configure();
$savemsg = get_std_save_message($retval);
+ /* Wipe out old relayd anchors no longer in use. */
+ cleanup_lb_marked();
clear_subsystem_dirty('loadbalancer');
}
}
@@ -66,6 +68,7 @@ if ($_GET['act'] == "del") {
if (array_key_exists($_GET['id'], $a_vs)) {
if (!$input_errors) {
+ cleanup_lb_mark_anchor($a_vs[$_GET['id']]['name']);
unset($a_vs[$_GET['id']]);
write_config();
mark_subsystem_dirty('loadbalancer');
diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php
index 4b68b6e..deda062 100755
--- a/usr/local/www/load_balancer_virtual_server_edit.php
+++ b/usr/local/www/load_balancer_virtual_server_edit.php
@@ -117,9 +117,13 @@ if ($_POST) {
if($_POST['sitedown'] == "")
unset($vsent['sitedown']);
- if (isset($id) && $a_vs[$id])
+ if (isset($id) && $a_vs[$id]) {
+ if ($a_vs[$id]['name'] != $_POST['name']) {
+ /* Because the VS name changed, mark the old name for cleanup. */
+ cleanup_lb_mark_anchor($a_vs[$id]['name']);
+ }
$a_vs[$id] = $vsent;
- else
+ } else
$a_vs[] = $vsent;
if ($changecount > 0) {
OpenPOWER on IntegriCloud