Page MenuHomeFreeBSD

Clamp porthash_max to IPPORT_MAX.
ClosedPublic

Authored by markj on Nov 1 2018, 3:31 PM.
Tags
None
Referenced Files
F147518659: D17803.id51583.diff
Wed, Mar 11, 2:33 PM
Unknown Object (File)
Sun, Mar 1, 4:56 PM
Unknown Object (File)
Fri, Feb 27, 12:50 AM
Unknown Object (File)
Mon, Feb 23, 2:24 AM
Unknown Object (File)
Feb 9 2026, 12:28 PM
Unknown Object (File)
Feb 2 2026, 5:07 PM
Unknown Object (File)
Jan 31 2026, 4:28 AM
Unknown Object (File)
Jan 12 2026, 1:20 AM
Subscribers

Details

Summary

The port hash function is just (lport & mask), so it makes no sense to
permit more than IPPORT_MAX hash table entries. On larger-memory
systems this just ends up wasting memory.

Also change the lbgroup hash table size to porthash_max, since it uses
the lport as a hash.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

  • Fix an off-by-one.
  • Retire INP_PCBLBGROUP_PORTHASH. It's identical to INP_PCBPORTHASH, and because we now size the hash tables accurately, it would be nice to consistently use the same port hash everywhere.
This revision is now accepted and ready to land.Dec 4 2018, 10:08 PM
This revision was automatically updated to reflect the committed changes.