File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -252,22 +252,22 @@ class DHCPServer extends Model {
252252 }
253253
254254 /**
255- * Initializes configurations objects for defined interface that have not yet configured the DHCP server
255+ * Initializes configuration objects for defined interface that have not yet configured the DHCP server
256256 */
257257 private function init_interfaces (): void {
258258 # Variables
259- $ ifs_using_dhcpd = array_keys ($ this ->get_config (path: $ this ->config_path , default: []));
259+ $ ifs_using_dhcp_server = array_keys ($ this ->get_config (path: $ this ->config_path , default: []));
260260
261261 # Loop through each defined interface
262- foreach (NetworkInterface:: read_all ()-> model_objects as $ if ) {
262+ foreach ($ this -> get_config ( " interfaces " , []) as $ if_id => $ if ) {
263263 # Skip this interface if it is not a static interface or the subnet value is greater than or equal to 31
264- if ($ if-> typev4 -> value !== ' static ' or $ if ->subnet ->value >= 31 ) {
264+ if (empty ( $ if[ " ipaddr " ]) or $ if [ " ipaddr " ] === " dhcp " or $ if ->subnet ->value >= 31 ) {
265265 continue ;
266266 }
267267
268268 # Otherwise, make this interface eligible for a DHCP server
269- if (!in_array ($ if -> id , $ ifs_using_dhcpd )) {
270- $ this ->set_config (path: "$ this ->config_path / $ if -> id " , value: []);
269+ if (!in_array ($ if_id , $ ifs_using_dhcp_server )) {
270+ $ this ->set_config (path: "$ this ->config_path / $ if_id " , value: []);
271271 }
272272 }
273273 }
You can’t perform that action at this time.
0 commit comments