Project

General

Profile

Actions

Regression #14845

closed

PHP error in 1:1 NAT rule list when a 1:1 NAT rule uses an interface macro for the external address

Added by yon Liu 6 months ago. Updated 5 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Rules / NAT
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.09
Release Notes:
Force Exclusion
Affected Version:
Affected Architecture:

Description

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/guiconfig.inc:408 Stack trace: #0 /usr/local/www/firewall_nat_1to1.php(154): pprint_address('wanip') #1 {main} thrown in /usr/local/www/guiconfig.inc on line 408 PHP ERROR: Type: 1, File: /usr/local/www/guiconfig.inc, Line: 408, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/guiconfig.inc:408 Stack trace: #0 /usr/local/www/firewall_nat_1to1.php(154): pprint_address('wanip') #1 {main} thrown


Files

Firewall_ NAT_ 1_1.jpg (242 KB) Firewall_ NAT_ 1_1.jpg yon Liu, 10/06/2023 05:10 AM
clipboard-202310071002-sjgi5.png (23.9 KB) clipboard-202310071002-sjgi5.png Lev Prokofev, 10/07/2023 06:02 AM
clipboard-202310071003-mg09o.png (123 KB) clipboard-202310071003-mg09o.png Lev Prokofev, 10/07/2023 06:03 AM
Actions #2

Updated by Lev Prokofev 6 months ago

Can confirm this bug,
tested on

23.09-DEVELOPMENT (amd64)
built on Thu Oct 5 6:00:00 UTC 2023
FreeBSD 14.0-CURRENT

Steps to reproduce:

Create NAT 1:1
Save the settings

Result:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/guiconfig.inc:408 Stack trace: #0 /usr/local/www/firewall_nat_1to1.php(154): pprint_address('10.150.100.25') #1 {main} thrown in /usr/local/www/guiconfig.inc on line 408 PHP ERROR: Type: 1, File: /usr/local/www/guiconfig.inc, Line: 408, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/guiconfig.inc:408 Stack trace: #0 /usr/local/www/firewall_nat_1to1.php(154): pprint_address('10.150.100.25') #1 {main} thrown
Actions #3

Updated by Jim Pingle 6 months ago

  • Tracker changed from Bug to Regression
  • Project changed from pfSense Plus to pfSense
  • Subject changed from firewall_nat_1to1 to PHP error in 1:1 NAT rule list when a 1:1 NAT rule uses an interface macro for the external address
  • Category changed from Unknown to Rules / NAT
  • Target version set to 2.8.0
  • Release Notes changed from Default to Force Exclusion
  • Plus Target Version set to 23.09
Actions #4

Updated by Jim Pingle 6 months ago

  • Assignee set to Jim Pingle
Actions #5

Updated by Jim Pingle 6 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #6

Updated by Lev Prokofev 6 months ago

The patch is working, however, I noticed two issues

1) Brackets after external IP

2) When you try to edit a rule the external IP disappears

tested on

23.09-DEVELOPMENT (amd64)
built on Thu Oct 5 6:00:00 UTC 2023
FreeBSD 14.0-CURRENT
Actions #7

Updated by Jim Pingle 6 months ago

I am not seeing either of those behaviors here on the latest snapshot or a patched system. I can edit a rule and the existing address is in place, and I see no parenthesis after the address. I tried on both Plus and CE, same experience on both.

Actions #8

Updated by Marcos M 6 months ago

  • Status changed from Feedback to In Progress
  • Assignee changed from Jim Pingle to Marcos M
Actions #9

Updated by Marcos M 6 months ago

  • Status changed from In Progress to Feedback

The issues noted in #note-6 occur when the IP address is also a VIP.

Applied in changeset 77ba34495de9cde375c589a85a420af242833efa.

Actions #10

Updated by Danilo Zrenjanin 6 months ago

  • Status changed from Feedback to Resolved

Tested against:

23.09.b.20231013.0600

Everything works as expected.

I am marking this case resolved.

Actions #11

Updated by Jim Pingle 5 months ago

  • Target version changed from 2.8.0 to 2.7.1
Actions

Also available in: Atom PDF