#
c4a32455 |
| 19-May-2023 |
Kristof Provost <kp@FreeBSD.org> |
pf: remove the use of caddr_t
Replace caddr_t with void *, or more accurate types.
Suggested by: glebius Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D40186
|
#
8c23afdb |
| 17-May-2023 |
Kajetan Staszkiewicz <vegeta@tuxpowered.net> |
pf: Standardize rtableid
Prepare for rtableid being included in struct pfsync_state where it will be int32_t. Make variables which will be set to and from it the same width.
Reviewed by: kp Sponsor
pf: Standardize rtableid
Prepare for rtableid being included in struct pfsync_state where it will be int32_t. Make variables which will be set to and from it the same width.
Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D40013
show more ...
|
#
8216f1a9 |
| 05-May-2023 |
Kristof Provost <kp@FreeBSD.org> |
pf: fix a few more prototypes
Fix function prototypes to use the same type for sa_family_t as the definition.
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
16303d2b |
| 03-May-2023 |
Kajetan Staszkiewicz <vegeta@tuxpowered.net> |
pf: improve source node error handling
Functions manipulating source nodes can fail due to various reasons like memory allocation errors, hitting configured limits or lack of redirection targets. En
pf: improve source node error handling
Functions manipulating source nodes can fail due to various reasons like memory allocation errors, hitting configured limits or lack of redirection targets. Ensure those errors are properly caught and propagated in the code. Increase the error counters not only when parsing the main ruleset but the NAT ruleset too.
Cherry-picked from development of D39880
Reviewed by: kp Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D39940
show more ...
|
#
7b676698 |
| 03-May-2023 |
Kristof Provost <kp@FreeBSD.org> |
pf: simplify structs with anonymous unions
Rather than playing preprocessor hacks use actual anonymous unions. No functional change.
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
db0a2bfd |
| 01-May-2023 |
Kajetan Staszkiewicz <vegeta@tuxpowered.net> |
pf: reduce number of hashing operations when handling source nodes
Reduce number of hashing operations when handling source nodes by always having a pointer to the hash row mutex in the source node.
pf: reduce number of hashing operations when handling source nodes
Reduce number of hashing operations when handling source nodes by always having a pointer to the hash row mutex in the source node. Provide macros for handling and asserting the mutex. Calculate the hash only once in pf_find_src_node() and then use this hash in subsequent operations.
Cherry-picked from development of D39880
Reviewed by: kp, mjg Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D39888
show more ...
|
#
ef661d4a |
| 24-Apr-2023 |
Christian McDonald <cmcdonald@netgate.com> |
pf: introduce ridentifier and labels to ether rules
Make Ethernet rules more similar to the usual layer 3 rules by also allowing ridentifier and labels to be set on them.
Reviewed by: kp Sponsored
pf: introduce ridentifier and labels to ether rules
Make Ethernet rules more similar to the usual layer 3 rules by also allowing ridentifier and labels to be set on them.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
2e6cdfe2 |
| 18-Apr-2023 |
Kristof Provost <kp@FreeBSD.org> |
pf: change pf_rules_lock and pf_ioctl_lock to per-vnet locks
Both pf_rules_lock and pf_ioctl_lock only ever affect one vnet, so there's no point in having these locks affect other vnets. (In fact, t
pf: change pf_rules_lock and pf_ioctl_lock to per-vnet locks
Both pf_rules_lock and pf_ioctl_lock only ever affect one vnet, so there's no point in having these locks affect other vnets. (In fact, the only lock in pf that can affect multiple vnets is pf_end_lock.)
That's especially important for the rules lock, because taking the write lock suspends all network traffic until it's released. This will reduce the impact a vnet running pf can have on other vnets, and improve concurrency on machines running multiple pf-enabled vnets.
Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39658
show more ...
|
#
af94d8cc |
| 18-Apr-2023 |
Kristof Provost <kp@FreeBSD.org> |
pf: fix incorrect lock define
PF_TABLE_STATS_ASSERT() should be checking pf_table_stats_lock not pf_rules_lock.
Fortunately the define is not yet used anywhere so this was harmless. Fix it anyway,
pf: fix incorrect lock define
PF_TABLE_STATS_ASSERT() should be checking pf_table_stats_lock not pf_rules_lock.
Fortunately the define is not yet used anywhere so this was harmless. Fix it anyway, in case it does get used.
Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
39282ef3 |
| 13-Apr-2023 |
Kajetan Staszkiewicz <vegeta@tuxpowered.net> |
pf: backport OpenBSD syntax of "scrub" option for "match" and "pass" rules
Introduce the OpenBSD syntax of "scrub" option for "match" and "pass" rules and the "set reassemble" flag. The patch is bac
pf: backport OpenBSD syntax of "scrub" option for "match" and "pass" rules
Introduce the OpenBSD syntax of "scrub" option for "match" and "pass" rules and the "set reassemble" flag. The patch is backward-compatible, pf.conf can be still written in FreeBSD-style.
Obtained from: OpenBSD MFC after: never Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D38025
show more ...
|
Revision tags: release/13.2.0 |
|
#
b52b61c0 |
| 12-Mar-2023 |
Kristof Provost <kp@FreeBSD.org> |
pf: distinguish forwarding and output cases for pf_refragment6()
Re-introduce PFIL_FWD, because pf's pf_refragment6() needs to know if we're ip6_forward()-ing or ip6_output()-ing.
ip6_forward() rel
pf: distinguish forwarding and output cases for pf_refragment6()
Re-introduce PFIL_FWD, because pf's pf_refragment6() needs to know if we're ip6_forward()-ing or ip6_output()-ing.
ip6_forward() relies on m->m_pkthdr.rcvif, at least for link-local traffic (for in6_get_unicast_scopeid()). rcvif is not set for locally generated traffic (e.g. from icmp6_reflect()), so we need to call the correct output function.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revisi: https://reviews.freebsd.org/D39061
show more ...
|
#
9c041b45 |
| 31-Dec-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: fix syncookies in conjunction with tcp fast port reuse
Basic scenario: we have a closed connection (In TCPS_FIN_WAIT_2), and get a new connection (i.e. SYN) re-using the tuple.
Without syncooki
pf: fix syncookies in conjunction with tcp fast port reuse
Basic scenario: we have a closed connection (In TCPS_FIN_WAIT_2), and get a new connection (i.e. SYN) re-using the tuple.
Without syncookies we look at the SYN, and completely unlink the old, closed state on the SYN. With syncookies we send a generated SYN|ACK back, and drop the SYN, never looking at the state table.
So when the ACK (i.e. the third step in the three way handshake for connection setup) turns up, we’ve not actually removed the old state, so we find it, and don’t do the syncookie dance, or allow the new connection to get set up.
Explicitly check for this in pf_test_state_tcp(). If we find a state in TCPS_FIN_WAIT_2 and the syncookie is valid we delete the existing state so we can set up the new state. Note that when we verify the syncookie in pf_test_state_tcp() we don't decrement the number of half-open connections to avoid an incorrect double decrement.
MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D37919
show more ...
|
Revision tags: release/12.4.0 |
|
#
8a8af942 |
| 22-Sep-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: bridge-to
Allow pf (l2) to be used to redirect ethernet packets to a different interface.
The intended use case is to send 802.1x challenges out to a side interface, to enable AT&T links to fun
pf: bridge-to
Allow pf (l2) to be used to redirect ethernet packets to a different interface.
The intended use case is to send 802.1x challenges out to a side interface, to enable AT&T links to function with pfSense as a gateway, rather than the AT&T provided hardware.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D37193
show more ...
|
#
133935d2 |
| 07-Oct-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: atomically increment state ids
Rather than using a per-cpu state counter, and adding in the CPU id we can atomically increment the number. This has the advantage of removing the assumption that
pf: atomically increment state ids
Rather than using a per-cpu state counter, and adding in the CPU id we can atomically increment the number. This has the advantage of removing the assumption that the CPU ID fits in 8 bits.
Event: Aberdeen Hackathon 2022 Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D36915
show more ...
|
#
1d090028 |
| 29-Sep-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: use time_to for timestamps
Use time_t rather than uint32_t to represent the timestamps. That means we have 64 bits rather than 32 on all platforms except i386, avoiding the Y2K38 issues on most
pf: use time_to for timestamps
Use time_t rather than uint32_t to represent the timestamps. That means we have 64 bits rather than 32 on all platforms except i386, avoiding the Y2K38 issues on most platforms.
Reviewed by: Zhenlei Huang Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D36837
show more ...
|
#
485be979 |
| 22-Aug-2022 |
Luiz Amaral <email@luiz.eng.br> |
pfsync: replace struct pfsync_pkt with int flags
Get rid of struct pfsync_pkt. It was used to store data on the stack to pass to all the submessage handlers, but only the flags part of it was ever u
pfsync: replace struct pfsync_pkt with int flags
Get rid of struct pfsync_pkt. It was used to store data on the stack to pass to all the submessage handlers, but only the flags part of it was ever used. Just pass the flags directly instead.
Reviewed by: kp Obtained from: OpenBSD Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D36294
show more ...
|
#
1f61367f |
| 31-May-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: support matching on tags for Ethernet rules
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D35362
|
Revision tags: release/13.1.0 |
|
#
0abcc1d2 |
| 22-Apr-2022 |
Reid Linnemann <rlinnemann@netgate.com> |
pf: Add per-rule timestamps for rule and eth_rule
Similar to ipfw rule timestamps, these timestamps internally are uint32_t snaps of the system time in seconds. The timestamp is CPU local and update
pf: Add per-rule timestamps for rule and eth_rule
Similar to ipfw rule timestamps, these timestamps internally are uint32_t snaps of the system time in seconds. The timestamp is CPU local and updated each time a rule or a state associated with a rule or state is matched.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34970
show more ...
|
#
812839e5 |
| 12-Apr-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: allow the use of tables in ethernet rules
Allow tables to be used for the l3 source/destination matching. This requires taking the PF_RULES read lock.
Sponsored by: Rubicon Communications, LLC
pf: allow the use of tables in ethernet rules
Allow tables to be used for the l3 source/destination matching. This requires taking the PF_RULES read lock.
Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34917
show more ...
|
#
9bb06778 |
| 29-Mar-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: support listing ethernet anchors
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
bd7762c8 |
| 28-Feb-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: add a rule rb tree
with md5 sum used as key.
This gets rid of the quadratic rule traversal when "keep_counters" is set.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
|
#
1a3e98a5 |
| 25-Feb-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: pre-compute rule hash
Makes it cheaper to compare rules when "keep_counters" is set. This also sets up keeping them in a RB tree.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Net
pf: pre-compute rule hash
Makes it cheaper to compare rules when "keep_counters" is set. This also sets up keeping them in a RB tree.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
93f8c38c |
| 25-Feb-2022 |
Mateusz Guzik <mjg@FreeBSD.org> |
pf: add pf_config_lock
For now only protects rule creation/destruction, but will allow gradually reducing the scope of rules lock when changing the rules.
Reviewed by: kp Sponsored by: Rubicon Comm
pf: add pf_config_lock
For now only protects rule creation/destruction, but will allow gradually reducing the scope of rules lock when changing the rules.
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate")
show more ...
|
#
ef88adc5 |
| 27-Mar-2022 |
Gordon Bergling <gbe@FreeBSD.org> |
pf(4): Fix a typo in a source code comment
- s/seaching/searching/
MFC after: 3 days
|
#
8a42005d |
| 08-Mar-2022 |
Kristof Provost <kp@FreeBSD.org> |
pf: support basic L3 filtering in the Ethernet rules
Allow filtering based on the source or destination IP/IPv6 address in the Ethernet layer rules.
Reviewed by: pauamma_gundo.com (man), debdrup (m
pf: support basic L3 filtering in the Ethernet rules
Allow filtering based on the source or destination IP/IPv6 address in the Ethernet layer rules.
Reviewed by: pauamma_gundo.com (man), debdrup (man) Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34482
show more ...
|