File tree Expand file tree Collapse file tree
pfSense-pkg-API/files/etc/inc/api/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ class APIFirewallVirtualIPCreate extends APIModel {
105105 if ($ this ->validated_data ["mode " ] === "carp " ) {
106106 # Check for our optional 'vhid' payload value. Assume default if none was specified.
107107 if (isset ($ this ->initial_data ['vhid ' ])) {
108- if ($ this ->__vhid_exists ($ this ->initial_data ['vhid ' ])) {
108+ if ($ this ->__vhid_exists ($ this ->initial_data [" interface " ], $ this -> initial_data [ 'vhid ' ])) {
109109 $ this ->errors [] = APIResponse \get (4027 );
110110 } elseif (1 > $ this ->initial_data ['vhid ' ] or $ this ->initial_data ['vhid ' ] > 255 ) {
111111 $ this ->errors [] = APIResponse \get (4028 );
@@ -153,14 +153,14 @@ class APIFirewallVirtualIPCreate extends APIModel {
153153 $ this ->validated_data ["type " ] = "network " ;
154154 }
155155
156- private function __vhid_exists ($ vhid ) {
156+ private function __vhid_exists ($ interface , $ vhid ) {
157157 # Loop through each virtual IP and ensure it is not using the requested vhid
158158 foreach ($ this ->config ["virtualip " ]["vip " ] as $ vip ) {
159- if (intval ($ vhid ) === intval ($ vip ["vhid " ])) {
159+ if ($ interface === $ vip [ " interface " ] && intval ($ vhid ) === intval ($ vip ["vhid " ])) {
160160 return true ;
161161 }
162162 }
163163 return false ;
164164 }
165165
166- }
166+ }
You can’t perform that action at this time.
0 commit comments