24.03.r.20240416.0005 Unable to add an IPV4 entry to the pfBlockerNG configuration
-
24.03.r.20240416.0005
pfBlockerNG version 3.2.0_9Whenever I try to add a new IPV4 entry I get a PHP error as per below:
Url from where this error occurs:
https://{pfSense IP}/pfblockerng/pfblockerng_category.php?type=ipv4PHP Errors: [20-Apr-2024 15:32:23 ******] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391 [20-Apr-2024 15:32:41 ******] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391 [20-Apr-2024 15:33:31 ******] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391 [23-Apr-2024 **:11:14 ******] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391
-
I can confirm this. If I try to add a feed, I get a crash.
Crash report begins. Anonymous machine information: amd64 15.0-CURRENT FreeBSD 15.0-CURRENT #0 plus-RELENG_24_03-n256311-e71f834dd81: Tue Apr 16 00:38:18 UTC 2024 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-24_03-main/obj/amd64/dyNDzqbt/var/jenkins/workspace/pfSense-Plus-snapshots-24_03-main/sources/FreeBS Crash report details: PHP Errors: [23-Apr-2024 11:55:50 Europe/Berlin] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391 Stack trace: #0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1) #1 {main} thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391 No FreeBSD crash data found.
-
Also happening for IPV6
-
@graphene A work-around can be found in this thread https://forum.netgate.com/topic/185207/24-03-development-php-fatal-error-uncaught-valueerror-range-argument-3
-
@pst Thank you!!
That did the trick.
The following lines need to be changed in the file: /usr/local/www/pfblockerng/pfblockerng_category_edit.php
Line 391 : $options_suppression_cidr = [ 'Disabled' => 'Disabled' ] + array_combine(range(1, 17, -1), range(1, 17, -1));
Line 1517 : $list = array('Disabled' => 'Disabled') + array_combine(range(1, 17, -1), range(1, 17, -1));Change required: change the 4 instances of the "-1" with 1. After the change the lines should look like this:
Line 391 : $options_suppression_cidr = [ 'Disabled' => 'Disabled' ] + array_combine(range(1, 17, 1), range(1, 17, 1));
Line 1517 : $list = array('Disabled' => 'Disabled') + array_combine(range(1, 17, 1), range(1, 17, 1)); -
@graphene Details for a System Patch can be found here: https://forum.netgate.com/post/1164566
-