diff options
author | Hangbin Liu <liuhangbin@gmail.com> | 2024-11-17 22:20:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 19:47:57 +0100 |
commit | 49e8a0e07b020bc4ad670758f364738b7cf86f0e (patch) | |
tree | 2ad0a2eafe29a9b0c2e448f8cae9375a7ba5ba87 /tools | |
parent | 63bc9a42a02ec3fc837006cec745632f1e546a59 (diff) | |
download | linux-49e8a0e07b020bc4ad670758f364738b7cf86f0e.tar.gz linux-49e8a0e07b020bc4ad670758f364738b7cf86f0e.tar.bz2 linux-49e8a0e07b020bc4ad670758f364738b7cf86f0e.zip |
wireguard: selftests: load nf_conntrack if not present
[ Upstream commit 0290abc9860917f1ee8b58309c2bbd740a39ee8e ]
Some distros may not load nf_conntrack by default, which will cause
subsequent nf_conntrack sets to fail. Load this module if it is not
already loaded.
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
[ Jason: add [[ -e ... ]] check so this works in the qemu harness. ]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Link: https://patch.msgid.link/20241117212030.629159-4-Jason@zx2c4.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/wireguard/netns.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/wireguard/netns.sh b/tools/testing/selftests/wireguard/netns.sh index 93e44410f170..4732c23e35ee 100755 --- a/tools/testing/selftests/wireguard/netns.sh +++ b/tools/testing/selftests/wireguard/netns.sh @@ -320,6 +320,7 @@ waitiface $netns1 vethc waitiface $netns2 veths n0 bash -c 'printf 1 > /proc/sys/net/ipv4/ip_forward' +[[ -e /proc/sys/net/netfilter/nf_conntrack_udp_timeout ]] || modprobe nf_conntrack n0 bash -c 'printf 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout' n0 bash -c 'printf 2 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout_stream' n0 iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 10.0.0.0/24 -j SNAT --to 10.0.0.1 |