Page MenuHomeFreeBSD

libpfctl: improve syncookie watermark calculation
ClosedPublic

Authored by kp on Sep 8 2022, 8:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 4:49 AM
Unknown Object (File)
May 17 2024, 12:29 PM
Unknown Object (File)
May 13 2024, 4:36 AM
Unknown Object (File)
Apr 26 2024, 1:11 PM
Unknown Object (File)
Mar 22 2024, 1:11 PM
Unknown Object (File)
Mar 22 2024, 11:58 AM
Unknown Object (File)
Mar 19 2024, 3:26 PM
Unknown Object (File)
Mar 19 2024, 3:19 PM
Subscribers

Details

Summary

Ensure that we always pass sane limits for the high and low watermark
values.
This is especially important if users do something silly, like set the
state limit to 1. In that case we wound up calculating 0/0 as a limit,
which gets rejected by the kernel.

While here also shift the calculation to use uint64_t, so we don't end
up with overflows (and subsequently higher low than high values) with
very large state limits.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

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

Event Timeline

kp requested review of this revision.Sep 8 2022, 8:54 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sep 12 2022, 8:21 AM
This revision was automatically updated to reflect the committed changes.