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).
This commit is contained in:
Ad Schellevis 2023-10-24 10:11:47 +02:00
parent b0f3e131f5
commit ad2e5e7515

View File

@ -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)) {