Page MenuHomeFreeBSD

pf: Use a macro to get the hash row in pf_find_state_byid()
ClosedPublic

Authored by markj on Wed, Mar 26, 12:33 PM.
Tags
None
Referenced Files
F113942230: D49518.diff
Sat, Apr 5, 11:16 PM
F113942229: D49518.diff
Sat, Apr 5, 11:16 PM
F113942228: D49518.diff
Sat, Apr 5, 11:16 PM
F113942227: D49518.diff
Sat, Apr 5, 11:16 PM
F113942226: D49518.diff
Sat, Apr 5, 11:16 PM
Unknown Object (File)
Fri, Apr 4, 5:56 AM
Unknown Object (File)
Tue, Apr 1, 7:21 AM
Unknown Object (File)
Sat, Mar 29, 9:48 AM

Details

Summary

This seems a bit preferable to open-coding it. No functional change
intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Wed, Mar 26, 12:49 PM

I personally would prefer something without underscore prefix. The latter usually means something internal and not supposed to be used. But both macro working on ID and macro working on state definitely have the same level of visibility and usage - are supposed to be used only in pf(4) internally.

I can suggest two options:

PF_IDHASHID(id)
PF_IDHASH(state)

or

PF_IDHASH(id)
PF_STHASH(state)

More options are also possible.

Use a different name for the ID hash macro.

This revision now requires review to proceed.Thu, Mar 27, 8:32 AM
This revision is now accepted and ready to land.Thu, Mar 27, 8:47 AM
https://reviews.freebsd.org/D49518