netfilter: nf_defrag: Skip defrag if NOTRACK is set
conntrack defrag is needed only if some module like CONNTRACK or NAT explicitly requests it. For plain forwarding scenarios, defrag is not needed and can be skipped if NOTRACK is set in a rule. Since conntrack defrag is currently higher priority than raw table, setting NOTRACK is not sufficient. We need to move raw to a higher priority for iptables only. This is achieved by introducing a module parameter "raw_before_defrag" which allows to change the priority of raw table to place it before defrag. By default, the parameter is disabled and the priority of raw table is NF_IP_PRI_RAW to support legacy behavior. If the module parameter is enabled, then the priority of the raw table is set to NF_IP_PRI_RAW_BEFORE_DEFRAG. Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
5ed001baee
commit
902d6a4c2a
6 changed files with 30 additions and 3 deletions
|
|
@ -57,6 +57,7 @@
|
|||
|
||||
enum nf_ip_hook_priorities {
|
||||
NF_IP_PRI_FIRST = INT_MIN,
|
||||
NF_IP_PRI_RAW_BEFORE_DEFRAG = -450,
|
||||
NF_IP_PRI_CONNTRACK_DEFRAG = -400,
|
||||
NF_IP_PRI_RAW = -300,
|
||||
NF_IP_PRI_SELINUX_FIRST = -225,
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
|
||||
enum nf_ip6_hook_priorities {
|
||||
NF_IP6_PRI_FIRST = INT_MIN,
|
||||
NF_IP6_PRI_RAW_BEFORE_DEFRAG = -450,
|
||||
NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
|
||||
NF_IP6_PRI_RAW = -300,
|
||||
NF_IP6_PRI_SELINUX_FIRST = -225,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue