diff --git a/opnsense/10-wan b/opnsense/10-wan index 69337cd..e0c53a2 100644 --- a/opnsense/10-wan +++ b/opnsense/10-wan @@ -14,7 +14,6 @@ require_once("system.inc"); // Read CARP event arguments $subsystem = !empty($argv[1]) ? $argv[1] : ''; $type = !empty($argv[2]) ? $argv[2] : ''; -$primary_vhid = '1'; // Accept only MASTER/BACKUP events if (!in_array($type, ['MASTER', 'BACKUP'])) { @@ -29,7 +28,10 @@ if (!preg_match('/^[a-z0-9_]+@\S+$/i', $subsystem)) { } // Only react to the primary VHID -if (!preg_match('/@' . preg_quote($primary_vhid, '/') . '$/', $subsystem)) { +list($vhid, $iface) = explode('@', $subsystem); +$primary_vhid = '1'; // + +if ($vhid !== $primary_vhid) { exit(0); // ignore events from other VHIDs }