Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'nf-24-02-15' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf

Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following batch contains Netfilter fixes for net:

1) Missing : in kdoc field in nft_set_pipapo.

2) Restore default DNAT behavior When a DNAT rule is configured via
iptables with different port ranges, from Kyle Swenson.

3) Restore flowtable hardware offload for bidirectional flows
by setting NF_FLOW_HW_BIDIRECTIONAL flag, from Felix Fietkau.

netfilter pull request 24-02-15

* tag 'nf-24-02-15' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
netfilter: nf_tables: fix bidirectional offload regression
netfilter: nat: restore default DNAT behavior
netfilter: nft_set_pipapo: fix missing : in kdoc
====================

Link: https://lore.kernel.org/r/20240214233818.7946-1-pablo@netfilter.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+7 -3
+4 -1
net/netfilter/nf_nat_core.c
··· 551 551 find_free_id: 552 552 if (range->flags & NF_NAT_RANGE_PROTO_OFFSET) 553 553 off = (ntohs(*keyptr) - ntohs(range->base_proto.all)); 554 - else 554 + else if ((range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL) || 555 + maniptype != NF_NAT_MANIP_DST) 555 556 off = get_random_u16(); 557 + else 558 + off = 0; 556 559 557 560 attempts = range_size; 558 561 if (attempts > NF_NAT_MAX_ATTEMPTS)
+1
net/netfilter/nft_flow_offload.c
··· 361 361 ct->proto.tcp.seen[1].flags |= IP_CT_TCP_FLAG_BE_LIBERAL; 362 362 } 363 363 364 + __set_bit(NF_FLOW_HW_BIDIRECTIONAL, &flow->flags); 364 365 ret = flow_offload_add(flowtable, flow); 365 366 if (ret < 0) 366 367 goto err_flow_add;
+2 -2
net/netfilter/nft_set_pipapo.h
··· 144 144 145 145 /** 146 146 * struct nft_pipapo_match - Data used for lookup and matching 147 - * @field_count Amount of fields in set 147 + * @field_count: Amount of fields in set 148 148 * @scratch: Preallocated per-CPU maps for partial matching results 149 149 * @bsize_max: Maximum lookup table bucket size of all fields, in longs 150 - * @rcu Matching data is swapped on commits 150 + * @rcu: Matching data is swapped on commits 151 151 * @f: Fields, with lookup and mapping tables 152 152 */ 153 153 struct nft_pipapo_match {