Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2231349ybi; Thu, 20 Jun 2019 11:16:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqw67gklcTnPzA7ddXS/ECGCbHv6Kpv/jECoWtRHrbvG1+/2pn3lJ+n33NLqVBUKYEeues0n X-Received: by 2002:a62:cdc8:: with SMTP id o191mr62622935pfg.74.1561054581077; Thu, 20 Jun 2019 11:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054581; cv=none; d=google.com; s=arc-20160816; b=ngfr4n4VAhY0kW8FnSh46bHn7ycUZ6Px5zf370u0hxGUUa/dJR8f1DR0QzjEkXHGgW KAxvlKROSOE5SgD8i/SUQXuICarm5KnUL93NfDM3a8rycI9VyXlWo0urzah3vlO2gMMk 4LPn/a22+MQ6riMHX644IxEQXxuAKk/bWgww57M+HjsNqRR316OOoKaH1XWnygFEjzKA pv2HQ/Lq7osbF7eI7q1YvcG5MJZQ7Yd2mW2CjUZsmMLe1rZg6tX2YqLpOnBU6POkYZ8W Ef+/+uhIh/WrT1aaMK6LllTUEjv/NZm4v1S7gmYwpEQVDWmFE90ObYOyNNzXUszz4tUV kmrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YrsLcBrBM5vCHpRWZSuaqWLn4xe3gDBZDqlnEQllHro=; b=atc+RmN/RL+vUF6nWkCG+p6d2M0iKszum9Xk+Z918iFwxqQCfgek547t+XwJsg5KwK VG0yi6mCAmb+4qLD4DOVvvM5nlxMt+jHoS+34bUvlNzwLTVa6nIZkk4kyqdl2XEYEUFS SaFVpHEeo3SyLZjRn2Fmq3US1EPMiErd9ql4RENeubt9YWHBcKKHglOWHB7m2isDDYy6 vQBBgqe6YVHA2NJUgRA7NuO6R3bApRSUu6/O8zItRpYGZr6o6VtwELFeaDyh7cyuE60V MJ92YvSn0QcQb08uIWx0AjfaG13QkOTtN90NSSdxx+uAo6NCMvsHkBs52PESoDDkT3kR mTGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1P66H9X8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z25si160567pgk.415.2019.06.20.11.16.06; Thu, 20 Jun 2019 11:16:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1P66H9X8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729494AbfFTSOq (ORCPT + 99 others); Thu, 20 Jun 2019 14:14:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729474AbfFTSOk (ORCPT ); Thu, 20 Jun 2019 14:14:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4385121530; Thu, 20 Jun 2019 18:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054479; bh=2ifiMgl8orG4/FZtSN1k/rJ/Xz6HkjDxpOnrOdsp394=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1P66H9X8wvarAQ7WHz0M1hbOvSHpeel1uzLLg1oyHDGfnLOd8lApsi5G1gBhM0KHd CHwVX07XgdYvV1QYJVzgrLB9HT3alT2LWvN4yY0Xn6pVVTRfHXSkjlKaZoCFnipWGh Ytg6WiNicPT5uHmE1KZrCinFKLGtq6Zao1+7IAWk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeffrin Jose T , Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.1 42/98] selftests: netfilter: missing error check when setting up veth interface Date: Thu, 20 Jun 2019 19:57:09 +0200 Message-Id: <20190620174351.022943386@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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: Jeffrin Jose T Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- 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 3194007cf8d1..a59c5fd4e987 100755 --- a/tools/testing/selftests/netfilter/nft_nat.sh +++ b/tools/testing/selftests/netfilter/nft_nat.sh @@ -23,7 +23,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.20.1