lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200814185544.8732-1-fabf@skynet.be>
Date:   Fri, 14 Aug 2020 20:55:44 +0200
From:   Fabian Frederick <fabf@...net.be>
To:     pablo@...filter.org, kadlec@...filter.org, fw@...len.de
Cc:     netfilter-devel@...r.kernel.org, coreteam@...filter.org,
        netdev@...r.kernel.org, Fabian Frederick <fabf@...net.be>
Subject: [PATCH 2/2 nf] selftests: netfilter: exit on invalid parameters

exit script with comments when parameters are wrong during address
addition. No need for a message when trying to change MTU with lower
values: output is self-explanatory

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 tools/testing/selftests/netfilter/nft_flowtable.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh
index 28e32fddf9b2c..c3617d0037f2e 100755
--- a/tools/testing/selftests/netfilter/nft_flowtable.sh
+++ b/tools/testing/selftests/netfilter/nft_flowtable.sh
@@ -97,9 +97,17 @@ do
 done
 
 ip -net nsr1 link set veth0 mtu $omtu
+if [ $? -ne 0 ]; then
+	exit 1
+fi
+
 ip -net ns1 link set eth0 mtu $omtu
 
 ip -net nsr2 link set veth1 mtu $rmtu
+if [ $? -ne 0 ]; then
+	exit 1
+fi
+
 ip -net ns2 link set eth0 mtu $rmtu
 
 # transfer-net between nsr1 and nsr2.
@@ -119,6 +127,11 @@ for i in 1 2; do
   ip -net ns$i addr add 10.0.$i.99/24 dev eth0
   ip -net ns$i route add default via 10.0.$i.1
   ip -net ns$i addr add dead:$i::99/64 dev eth0
+  if [ $? -ne 0 ]; then
+	echo "ERROR: Check Originator/Responder values (problem during address addition)" 1>&2
+	exit 1
+  fi
+
   ip -net ns$i route add default via dead:$i::1
   ip netns exec ns$i sysctl net.ipv4.tcp_no_metrics_save=1 > /dev/null
 
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ