Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175692444
D36497.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
900 B
Referenced Files
None
Subscribers
None
D36497.diff
View Options
diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c
--- a/lib/libpfctl/libpfctl.c
+++ b/lib/libpfctl/libpfctl.c
@@ -1335,17 +1335,25 @@
nvlist_t *nvl;
int ret;
uint state_limit;
+ uint64_t lim, hi, lo;
ret = pfctl_get_limit(dev, PF_LIMIT_STATES, &state_limit);
if (ret != 0)
return (ret);
+ lim = state_limit;
+ hi = lim * s->highwater / 100;
+ lo = lim * s->lowwater / 100;
+
+ if (lo == hi)
+ hi++;
+
nvl = nvlist_create(0);
nvlist_add_bool(nvl, "enabled", s->mode != PFCTL_SYNCOOKIES_NEVER);
nvlist_add_bool(nvl, "adaptive", s->mode == PFCTL_SYNCOOKIES_ADAPTIVE);
- nvlist_add_number(nvl, "highwater", state_limit * s->highwater / 100);
- nvlist_add_number(nvl, "lowwater", state_limit * s->lowwater / 100);
+ nvlist_add_number(nvl, "highwater", hi);
+ nvlist_add_number(nvl, "lowwater", lo);
nv.data = nvlist_pack(nvl, &nv.len);
nv.size = nv.len;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 13, 1:55 PM (14 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40753873
Default Alt Text
D36497.diff (900 B)
Attached To
Mode
D36497: libpfctl: improve syncookie watermark calculation
Attached
Detach File
Event Timeline
Log In to Comment