User Details
- User Since
- Sep 6 2022, 11:10 AM (123 w, 5 d)
Dec 9 2024
Improve the situation a bit: force logging if state creation fails.
This isn't totally right as we'll end up logging the packet twice in
this case, but it's better than not logging the drop at all.
Dec 5 2024
Dec 4 2024
Improve some comments.
Dec 3 2024
Nov 29 2024
Restore the old value of _Static_assert(sizeof(struct pf_kstate))
Plug holes in pf_rule_actions
Nov 28 2024
Use style(9)-compliant boolean tests
As promised yesterday, I propose how to get further with simplifying source node handling. This is a draft/proposal, however it compiles and passes all tests, at least the ones not skipped, which for me are dummynet and altq, I need to revive my custom kernel config to get those running.
Change limited to bool. Fix one missing PF_SRC_NODE… macro.
Make pf_hashsrc() available from everywhere. Use PF_SRC_NODE… macros now that pf_hashsrc() is accessible. The OB1 error in pf_insert_src_node() is gone, adjust the tests accordingly. Simplify pf_src_connlimit() logic,
Nov 27 2024
Nov 26 2024
This patch only aims to fix issues with locking, not the other issues found in D39880 (which will require some modifications, as while writing this one, I found some issues with the 2 different paths reaching pf_map_addr_sn(), which D39880 does not take into account). I suppose it could be MFC'd into the currently maintained releases of FreeBSD after more testing.
Nov 22 2024
Nov 21 2024
There's no need for additional variable, time is used only once.
Nov 20 2024
This code suffers from very old OpenBSD idea of (ab)using the same data structure for in-kernel storage and communication with userspace over ioctl. There is no need for struct pf_threshold *t, as pfctl only displays its count and seconds properties. Instead of having a separate function nlattr_add_pf_threshold() with all its PF_TH_… variables we could just add new variables PF_SN_CONN_RATE_RATE and PF_SN_CONN_RATE_SECONDS directly into the source node. And rename PF_SN_CREATION to PF_SN_AGE since it's the age of the SN, calculated during the export, not its creation time, as stored in kernel.
Nov 19 2024
This is also broken on FreeBSD 14.
Nov 15 2024
Nov 13 2024
Closed by commit rG65b20771713c: pf tests: Simplify handling of pfctl -s
Nov 12 2024
Nov 4 2024
Oct 29 2024
Removed debug echos from tests.
Oct 28 2024
Oct 4 2024
A more recent, slightly simplified version.
Oct 2 2024
Oct 1 2024
Sep 29 2024
Sep 28 2024
Add test for another source, describe tests better, check for source nodes in order-independent manner.
Sep 27 2024
Update rules to match only on inet6 proto tcp.
Fix wrong cleanup function. Rename the test to …_rule because there will be in future another test for global source tracking.
Update test for the hitting the max-src-conn rule so that it works both when the state is found CLOSED or when there is no state at all.
Sep 26 2024
Simplify the check_tcp_3way functions, there is no need to sniff for our own ACK. Once it's sent out, we can assume the check has passed.
Removed the change in pf.c as the error was in the ruleset.
I've withdrawn the move of the check from within to the outside of pf_create_state(). The way source nodes are cleaned up in case of state creation failure in the current code would not play nice with this change. The change comes from my own branch where source nodes allocation is performed slightly differently. I'll re-upload this patch when the time is right.