From ad2e5e751569e893c63f85ca6c9dc2432553ca35 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 24 Oct 2023 10:11:47 +0200 Subject: [PATCH] Interfaces: Virtual IPs: Settings - fix config locking when deleting a node. This is a bit of a tricky one, delBase() always locks, which enforces the proper sequence in concurrent operations, but when reading the config first with getModel(), we are locking the wrong state (memory doesn't equal disk anymore). --- .../OPNsense/Interfaces/Api/VipSettingsController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Interfaces/Api/VipSettingsController.php b/src/opnsense/mvc/app/controllers/OPNsense/Interfaces/Api/VipSettingsController.php index b89053d0c..84ba8edd3 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Interfaces/Api/VipSettingsController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Interfaces/Api/VipSettingsController.php @@ -176,6 +176,7 @@ class VipSettingsController extends ApiMutableModelControllerBase public function delItemAction($uuid) { + Config::getInstance()->lock(); $node = $this->getModel()->getNodeByReference('vip.' . $uuid); $validations = $this->getModel()->whereUsed((string)$node->subnet); if (!empty($validations)) {