Skip to content

Commit d74b23d

Browse files
author
Paolo Abeni
committed
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/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
2 parents f3ac28e + 8444374 commit d74b23d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

net/netfilter/nf_nat_core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,11 @@ static void nf_nat_l4proto_unique_tuple(struct nf_conntrack_tuple *tuple,
551551
find_free_id:
552552
if (range->flags & NF_NAT_RANGE_PROTO_OFFSET)
553553
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)
555556
off = get_random_u16();
557+
else
558+
off = 0;
556559

557560
attempts = range_size;
558561
if (attempts > NF_NAT_MAX_ATTEMPTS)

net/netfilter/nft_flow_offload.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ static void nft_flow_offload_eval(const struct nft_expr *expr,
361361
ct->proto.tcp.seen[1].flags |= IP_CT_TCP_FLAG_BE_LIBERAL;
362362
}
363363

364+
__set_bit(NF_FLOW_HW_BIDIRECTIONAL, &flow->flags);
364365
ret = flow_offload_add(flowtable, flow);
365366
if (ret < 0)
366367
goto err_flow_add;

net/netfilter/nft_set_pipapo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ struct nft_pipapo_scratch {
144144

145145
/**
146146
* 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
148148
* @scratch: Preallocated per-CPU maps for partial matching results
149149
* @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
151151
* @f: Fields, with lookup and mapping tables
152152
*/
153153
struct nft_pipapo_match {

0 commit comments

Comments
 (0)