Page MenuHomeFreeBSD

libpfctl: remove the state getters that do not take a handle
Needs ReviewPublic

Authored by rcm on Fri, Oct 2, 1:59 PM.
Tags
None
Referenced Files
F174448062: D60248.id188393.diff
Sat, Oct 3, 7:31 AM
F174420989: D60248.diff
Sat, Oct 3, 1:56 AM
F174419025: D60248.diff
Sat, Oct 3, 1:36 AM
Subscribers

Details

Reviewers
kp
Summary

Nothing in the tree calls any of the three. Remove them rather than
fix them: pfctl_get_states_h() does the same with the handle that the
caller has. pfctl_free_states(), struct pfctl_states and the list
entry in struct pfctl_state were there for pfctl_get_states() alone,
and go with it.

Fixes: 2a478dfc7f9c ("libpfctl: retrieve family id only once")
Sponsored by: Rubicon Communications, LLC ("Netgate")

Test Plan

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rcm requested review of this revision.Fri, Oct 2, 1:59 PM

I wonder if we shouldn't just remove these versions of the get_states functions altogether.

This version is unhelpful because it doesn't take the pfctl_handle. There's a _h variant which does, and which should get used instead.

In D60248#1382592, @kp wrote:

I wonder if we shouldn't just remove these versions of the get_states functions altogether.

This version is unhelpful because it doesn't take the pfctl_handle. There's a _h variant which does, and which should get used instead.

Yes let's do that. The one out-of-tree caller I know of is the pfSense PHP module, which I'll move to pfctl_get_states_h.

rcm retitled this revision from libpfctl: look up the netlink family in pfctl_get_filtered_states_iter() to libpfctl: remove the state getters that do not take a handle.
rcm edited the summary of this revision. (Show Details)
rcm edited the test plan for this revision. (Show Details)

pivoted to just removing these getters entirely