Project

General

Profile

Actions

Bug #15299

closed

Old auto-added MAC addresses are not pruned for non-concurrent Captive Portal sessions

Added by Roddy Roddy 9 months ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Captive Portal
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
24.03
Release Notes:
Default
Affected Version:
2.7.2
Affected Architecture:

Description

Hi guys! Could anyone help me to fix this issue, please?

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:
[29-Feb-2024 20:07:27 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/captiveportal.inc:1084
Stack trace:
#0 /etc/inc/captiveportal.inc(826): captiveportal_ether_delete_entry('7a:59:3f:e8:28:...', 'auth')
#1 /etc/inc/captiveportal.inc(797): captiveportal_prune_old_automac()
#2 /etc/rc.prunecaptiveportal(56): captiveportal_prune_old()
#3 {main}
thrown in /etc/inc/captiveportal.inc on line 1084


Files

Actions #1

Updated by Jim Pingle 9 months ago

  • Project changed from pfSense Packages to pfSense
  • Category changed from System Patches to Captive Portal
  • Priority changed from Urgent to Normal
  • Release Notes set to Default

Did the error happen in the background or did it happen when you made an action of some sort in the GUI?

If it happened when you did something in the GUI, what action triggered the error?

Actions #2

Updated by Roddy Roddy 9 months ago

Jim Pingle wrote in #note-1:

Did the error happen in the background or did it happen when you made an action of some sort in the GUI?

If it happened when you did something in the GUI, what action triggered the error?

Hi Jim,

It's just happen when I active captive portal. If I disable it, the error messages disappear.

Actions #3

Updated by Jim Pingle 9 months ago

  • Target version set to 2.8.0
  • Plus Target Version set to 24.03

Looks like it may be related to pass-through MACs when noconcurrentlogins is set along with per-user limits.

captiveportal_ether_delete_entry() expects a host entry with an array containing an IP address in the 'ip' key but captiveportal_prune_old_automac() is passing a MAC Address directly to that function which isn't valid.

In/near source:src/etc/inc/captiveportal.inc#L824:

                    $pipes = captiveportal_get_dn_passthru_pipes($temac['mac']);
                    if ($pipes) {
                        captiveportal_ether_delete_entry($temac['mac'], 'auth');
                    }

Looks like maybe that should be passing $temac there but that may not be right since that might not have an IP address in it either, though there is a reference to it a couple lines down.

Either way what's there now is wrong and needs investigated/fixed.

Actions #4

Updated by Roddy Roddy 9 months ago

Jim Pingle wrote in #note-3:

Looks like it may be related to pass-through MACs when noconcurrentlogins is set along with per-user limits.

captiveportal_ether_delete_entry() expects a host entry with an array containing an IP address in the 'ip' key but captiveportal_prune_old_automac() is passing a MAC Address directly to that function which isn't valid.

In/near source:src/etc/inc/captiveportal.inc#L824:
[...]

Looks like maybe that should be passing $temac there but that may not be right since that might not have an IP address in it either, though there is a reference to it a couple lines down.

Either way what's there now is wrong and needs investigated/fixed.

"I disabled the 'Pass-through MAC Auto Entry' on the Captive Portal, and the error messages have stopped. However, now, to avoid these messages, I need to add these entries manually. It seems like a bug. Anyway, it's exhibiting some unusual behavior.

Thank you for your assistance, Jim! Best regards!"

Actions #5

Updated by Marcos M 9 months ago

  • Subject changed from PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/captiveportal.inc:1084 to Old auto-added MAC addresses are not pruned for non-concurrent Captive Portal sessions
  • Status changed from New to Pull Request Review
  • Assignee set to Marcos M
  • Affected Architecture deleted (amd64)
Actions #6

Updated by Marcos M 9 months ago

  • Status changed from Pull Request Review to Feedback
  • % Done changed from 0 to 100
Actions #7

Updated by Jim Pingle 7 months ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF