diff options
author | Jeffrin Jose T <jeffrin@rajagiritech.edu.in> | 2019-05-15 12:14:04 +0530 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-05-21 20:12:20 +0200 |
commit | 82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 (patch) | |
tree | 61600f69f63687f96a423b2793ed7a0710748fb3 /tools | |
parent | 719c7d563c17b150877cee03a4b812a424989dfa (diff) | |
download | linux-82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43.tar.gz linux-82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43.tar.bz2 linux-82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43.zip |
selftests: netfilter: missing error check when setting up veth interface
A test for the basic NAT functionality uses ip command which needs veth
device. There is a condition where the kernel support for veth is not
compiled into the kernel and the test script breaks. This patch contains
code for reasonable error display and correct code exit.
Signed-off-by: Jeffrin Jose T <jeffrin@rajagiritech.edu.in>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/testing/selftests/netfilter/nft_nat.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/testing/selftests/netfilter/nft_nat.sh b/tools/testing/selftests/netfilter/nft_nat.sh index 21159f5f3362..f102a65aa8b7 100755 --- a/tools/testing/selftests/netfilter/nft_nat.sh +++ b/tools/testing/selftests/netfilter/nft_nat.sh @@ -24,7 +24,11 @@ ip netns add ns0 ip netns add ns1 ip netns add ns2 -ip link add veth0 netns ns0 type veth peer name eth0 netns ns1 +ip link add veth0 netns ns0 type veth peer name eth0 netns ns1 > /dev/null 2>&1 +if [ $? -ne 0 ];then + echo "SKIP: No virtual ethernet pair device support in kernel" + exit $ksft_skip +fi ip link add veth1 netns ns0 type veth peer name eth0 netns ns2 ip -net ns0 link set lo up |