提交 ef4ffa0f 编写于 作者: J Jeffrin Jose T 提交者: Greg Kroah-Hartman

selftests: netfilter: missing error check when setting up veth interface

[ Upstream commit 82ce6eb1dd13fd12e449b2ee2c2ec051e6f52c43 ]

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: NJeffrin Jose T <jeffrin@rajagiritech.edu.in>
Acked-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 61c83de6
...@@ -23,7 +23,11 @@ ip netns add ns0 ...@@ -23,7 +23,11 @@ ip netns add ns0
ip netns add ns1 ip netns add ns1
ip netns add ns2 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 link add veth1 netns ns0 type veth peer name eth0 netns ns2
ip -net ns0 link set lo up ip -net ns0 link set lo up
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册