Describe the bug
Error and Crash when updating DHCPd. Seems to be reproducible on demand. It actually succeeds in the update and the configuration is applied, but the error/crash still occur. Here's the crash report:
Crash report begins. Anonymous machine information:
amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT amd64 1400094 #1 RELENG_2_7_2-n255948-8d2b56da39c: Wed Dec 6 20:45:47 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_2-main/obj/amd64/StdASW5b/var/jenkins/workspace/pfSense-CE-snapshots-2_7_2-main/sources/F
Crash report details:
PHP Errors:
[25-Jun-2024 10:37:59 Etc/UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int - string in /etc/inc/api/framework/APITools.inc:1042
Stack trace:
#0 /etc/inc/api/models/APIServicesDHCPdUpdate.inc(97): APITools\is_ipv4_in_cidr(3232240740, 'dhcp/')
#1 /etc/inc/api/models/APIServicesDHCPdUpdate.inc(40): APIServicesDHCPdUpdate->__validate_range_from()
#2 /etc/inc/api/framework/APIModel.inc(199): APIServicesDHCPdUpdate->validate_payload()
#3 /etc/inc/api/framework/APIModel.inc(211): APIModel->validate()
#4 /etc/inc/api/endpoints/APIServicesDHCPd.inc(28): APIModel->call()
#5 /etc/inc/api/framework/APIEndpoint.inc(66): APIServicesDHCPd->put()
#6 /usr/local/www/api/v1/services/dhcpd/index.php(3): APIEndpoint->listen()
#7 {main}
thrown in /etc/inc/api/framework/APITools.inc on line 1042
No FreeBSD crash data found.
To Reproduce
curl -X 'PUT'
'https:///api/v1/services/dhcpd'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"interface": "<name>",
"enable": true,
"range_from": "192.168.2.100",
"range_to": "192.168.2.200"
}'
Expected behavior
DHCP server is created/updated on the specified interface without a crash
Screenshots or Response
See above crash report
pfSense Version & Package Version:
- pfSense Version: 2.7.2-RELEASE (amd64)
Affected Endpoints:
- URL: /api/v1/services/dhcpd
Describe the bug
Error and Crash when updating DHCPd. Seems to be reproducible on demand. It actually succeeds in the update and the configuration is applied, but the error/crash still occur. Here's the crash report:
Crash report begins. Anonymous machine information:
amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT amd64 1400094 #1 RELENG_2_7_2-n255948-8d2b56da39c: Wed Dec 6 20:45:47 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_2-main/obj/amd64/StdASW5b/var/jenkins/workspace/pfSense-CE-snapshots-2_7_2-main/sources/F
Crash report details:
PHP Errors:
[25-Jun-2024 10:37:59 Etc/UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: int - string in /etc/inc/api/framework/APITools.inc:1042
Stack trace:
#0 /etc/inc/api/models/APIServicesDHCPdUpdate.inc(97): APITools\is_ipv4_in_cidr(3232240740, 'dhcp/')
#1 /etc/inc/api/models/APIServicesDHCPdUpdate.inc(40): APIServicesDHCPdUpdate->__validate_range_from()
#2 /etc/inc/api/framework/APIModel.inc(199): APIServicesDHCPdUpdate->validate_payload()
#3 /etc/inc/api/framework/APIModel.inc(211): APIModel->validate()
#4 /etc/inc/api/endpoints/APIServicesDHCPd.inc(28): APIModel->call()
#5 /etc/inc/api/framework/APIEndpoint.inc(66): APIServicesDHCPd->put()
#6 /usr/local/www/api/v1/services/dhcpd/index.php(3): APIEndpoint->listen()
#7 {main}
thrown in /etc/inc/api/framework/APITools.inc on line 1042
No FreeBSD crash data found.
To Reproduce
curl -X 'PUT'
'https:///api/v1/services/dhcpd'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"interface": "<name>",
"enable": true,
"range_from": "192.168.2.100",
"range_to": "192.168.2.200"
}'
Expected behavior
DHCP server is created/updated on the specified interface without a crash
Screenshots or Response
See above crash report
pfSense Version & Package Version:
Affected Endpoints: