summaryrefslogtreecommitdiffstats
path: root/usr/local/www
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:51:52 -0400
commitb8131408db568b67c42a70490b0b2ec1bda84c13 (patch)
tree319e8450d159e9d5a21990ac229cbe83148b2a97 /usr/local/www
parent1702a838194d2f4ffaa99359f888a42b0832472a (diff)
downloadpfsense-b8131408db568b67c42a70490b0b2ec1bda84c13.zip
pfsense-b8131408db568b67c42a70490b0b2ec1bda84c13.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/www')
-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 b2e73b1..32d8cdd 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