Skip to content

Captive Portal: re-introduce hash lookup for accounting purposes#10275

Open
swhite2 wants to merge 4 commits intomasterfrom
cp-ipfw-tables
Open

Captive Portal: re-introduce hash lookup for accounting purposes#10275
swhite2 wants to merge 4 commits intomasterfrom
cp-ipfw-tables

Conversation

@swhite2
Copy link
Copy Markdown
Member

@swhite2 swhite2 commented May 8, 2026

Important notices

Before you submit a pull request, we ask you kindly to acknowledge the following:

If AI was used, please disclose:

  • Model used:
  • Extent of AI involvement:

Describe the problem

Table redirection allowed for constant time lookups, with the migration to pf this was changed to a linear time lookup.

While here, fix a small edge case that kills states for ips flipping primary IPs according to hostwatch. Also make sure to include the set of ipfw keys to "registered addresses" to make sure theyre properly cleaned up from the table


Describe the proposed solution

Reuse table lookups.

The add_accounting logic now expects the full set of IP addresses associated with a single client to make sure they use the same rulenumber, this allows us to prevent wasting space in the ruleset. del_accounting is unaffected.


Related issue

#9355

Table redirection allowed for constant time lookups, with the
migration to pf this was changed to a linear time lookup.

While here, fix a small edge case that kills states for ips
flipping primary IPs according to hostwatch. Also make sure
to include the set of ipfw keys to "registered addresses" to make
sure theyre properly cleaned up from the table
@swhite2 swhite2 requested a review from AdSchellevis May 8, 2026 13:07
@swhite2 swhite2 self-assigned this May 8, 2026
Comment thread src/opnsense/scripts/captiveportal/lib/ipfw.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants