From patchwork Mon Dec 20 14:34:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 527051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95A64C4321E for ; Mon, 20 Dec 2021 14:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235785AbhLTOpp (ORCPT ); Mon, 20 Dec 2021 09:45:45 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:51966 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234708AbhLTOoI (ORCPT ); Mon, 20 Dec 2021 09:44:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 18358B80EE5; Mon, 20 Dec 2021 14:44:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65220C36AE9; Mon, 20 Dec 2021 14:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1640011445; bh=xYfL3n6VFQ9nX3nu5e6RN3asDP2W/fiBl1SFrcWxS0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pA9JEFOdfELqxUIxPPbK3ZUKmZrmlQrIE5tISXZIvW4Bw0bfgC4KZKOzFjCbX3aW5 Dkkcwvm8rXt4hlYNb/9xwSzdKavcWhi/p+4jWk0zhtul34vVw4/kNspbFJa3Ok4yHZ cTDUrikhLeqDdpHK5z75QUQezRwc2FRzb5WO4AvA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Zhijian , David Ahern , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 23/71] selftests: Fix raw socket bind tests with VRF Date: Mon, 20 Dec 2021 15:34:12 +0100 Message-Id: <20211220143026.466169184@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211220143025.683747691@linuxfoundation.org> References: <20211220143025.683747691@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: David Ahern [ Upstream commit 0f108ae4452025fef529671998f6c7f1c4526790 ] Commit referenced below added negative socket bind tests for VRF. The socket binds should fail since the address to bind to is in a VRF yet the socket is not bound to the VRF or a device within it. Update the expected return code to check for 1 (bind failure) so the test passes when the bind fails as expected. Add a 'show_hint' comment to explain why the bind is expected to fail. Fixes: 75b2b2b3db4c ("selftests: Add ipv4 address bind tests to fcnal-test") Reported-by: Li Zhijian Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- tools/testing/selftests/net/fcnal-test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh index 475ac62373e92..c8f28e847ee9e 100755 --- a/tools/testing/selftests/net/fcnal-test.sh +++ b/tools/testing/selftests/net/fcnal-test.sh @@ -1491,8 +1491,9 @@ ipv4_addr_bind_vrf() for a in ${NSA_IP} ${VRF_IP} do log_start + show_hint "Socket not bound to VRF, but address is in VRF" run_cmd nettest -s -R -P icmp -l ${a} -b - log_test_addr ${a} $? 0 "Raw socket bind to local address" + log_test_addr ${a} $? 1 "Raw socket bind to local address" log_start run_cmd nettest -s -R -P icmp -l ${a} -d ${NSA_DEV} -b