netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 05/11] selftests: netfilter: missing error check when setting up veth interface
Date: Thu, 23 May 2019 23:35:41 +0200	[thread overview]
Message-ID: <20190523213547.15523-6-pablo@netfilter.org> (raw)
In-Reply-To: <20190523213547.15523-1-pablo@netfilter.org>

From: Jeffrin Jose T <jeffrin@rajagiritech.edu.in>

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>
---
 tools/testing/selftests/netfilter/nft_nat.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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
-- 
2.11.0


  parent reply	other threads:[~2019-05-23 21:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 21:35 [PATCH 00/11] Netfilter/IPVS fixes for net Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 01/11] netfilter: nf_tables: fix oops during rule dump Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 02/11] netfilter: nf_queue: fix reinject verdict handling Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 03/11] netfilter: nft_fib: Fix existence check support Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 04/11] ipvs: Fix use-after-free in ip_vs_in Pablo Neira Ayuso
2019-05-23 21:35 ` Pablo Neira Ayuso [this message]
2019-05-23 21:35 ` [PATCH 06/11] netfilter: nat: fix udp checksum corruption Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 07/11] netfilter: nf_flow_table: ignore DF bit setting Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 08/11] netfilter: nft_flow_offload: set liberal tracking mode for tcp Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 09/11] netfilter: nft_flow_offload: don't offload when sequence numbers need adjustment Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 10/11] netfilter: nft_flow_offload: IPCB is only valid for ipv4 family Pablo Neira Ayuso
2019-05-23 21:35 ` [PATCH 11/11] selftests: netfilter: add flowtable test script Pablo Neira Ayuso
2019-05-23 21:45 ` [PATCH 00/11] Netfilter/IPVS fixes for net David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190523213547.15523-6-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).