linux/tools
Florian Westphal 5ec8ca26fe netfilter: nf_nat: remove bogus direction check
Jakub reports spurious failures of the 'conntrack_reverse_clash.sh'
selftest.  A bogus test makes nat core resort to port rewrite even
though there is no need for this.

When the test is made, nf_nat_used_tuple() would already have caused us
to return if no other CPU had added a colliding entry.
Moreover, nf_nat_used_tuple() would have ignored the colliding entry if
their origin tuples had been the same.

All that is left to check is if the colliding entry in the hash table
is subject to NAT, and, if its not, if our entry matches in the reverse
direction, e.g. hash table has

addr1:1234 -> addr2:80, and we want to commit
addr2:80   -> addr1:1234.

Because we already checked that neither the new nor the committed entry is
subject to NAT we only have to check origin vs. reply tuple:
for non-nat entries, the reply tuple is always the inverted original.

Just in case there are more problems extend the error reporting
in the selftest while at it and dump conntrack table/stats on error.

Reported-by: Jakub Kicinski <kuba@kernel.org>
Closes: https://lore.kernel.org/netdev/20251206175135.4a56591b@kernel.org/
Fixes: d8f84a9bc7 ("netfilter: nf_nat: don't try nat source port reallocation for reverse dir clash")
Signed-off-by: Florian Westphal <fw@strlen.de>
2025-12-11 13:08:37 +01:00
..
accounting tools/delaytop: improve error handling for missing PSI support 2025-09-13 17:32:56 -07:00
arch arm64 updates for 6.19: 2025-12-02 17:03:55 -08:00
bootconfig bootconfig: Fix negative seeks on 32-bit with LFS enabled 2025-08-21 08:16:31 +09:00
bpf bpf: Remove runqslower tool 2025-11-28 15:20:16 -08:00
build objtool updates for v6.19: 2025-12-01 20:18:59 -08:00
certs
cgroup
counter
crypto
debugging
docs docs: makefile: move rustdoc check to the build wrapper 2025-11-29 08:42:53 -07:00
firewire
firmware
gpio tools: gpio: remove the include directory on make clean 2025-09-04 16:29:28 +02:00
hv
iio iio: add power and energy measurement modifiers 2025-09-13 13:47:19 +01:00
include Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
kvm/kvm_stat
laptop
leds
lib bpf-next-6.19 2025-12-03 16:54:54 -08:00
memory-model
mm tools/mm/slabinfo: fix access to null terminator in string boundary 2025-09-21 14:22:00 -07:00
net tools: ynl: fix build on systems with old kernel headers 2025-12-08 23:53:17 -08:00
objtool objtool: Fix segfault on unknown alternatives 2025-12-01 10:42:27 +01:00
pcmcia
perf Networking changes for 6.19. 2025-12-03 17:24:33 -08:00
power Power management updates for 6.19-rc1 2025-12-02 17:31:22 -08:00
rcu
sched
sched_ext sched_ext: tools: Removing duplicate targets during non-cross compilation 2025-11-20 07:00:27 -10:00
scripts tools headers: Sync syscall tables with the kernel source 2025-08-18 13:49:25 -07:00
sound
spi
testing netfilter: nf_nat: remove bogus direction check 2025-12-11 13:08:37 +01:00
thermal tools/thermal/thermal-engine: Fix format string bug in thermal-engine 2025-11-25 11:00:28 +01:00
time
tracing tracing/tools: Fix incorrcet short option in usage text for --threads 2025-11-07 07:59:37 -05:00
usb tools/usb/usbip: fix spelling mistakes in usbipd.c 2025-09-06 15:22:14 +02:00
verification rv: Add opid per-cpu monitor 2025-07-28 16:47:35 -04:00
virtio kmsan: convert kmsan_handle_dma to use physical addresses 2025-09-12 00:18:20 +02:00
wmi
workqueue
writeback
Makefile