Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2510628rwb; Mon, 3 Oct 2022 01:37:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7DUHpwLK5F8I2iYHiOEWjKCVQTZjXIbnmfLxLixjH2wBNqldwgdtkkEyJue1jyKldD0OLt X-Received: by 2002:a17:90a:6003:b0:20a:6fa6:b5b with SMTP id y3-20020a17090a600300b0020a6fa60b5bmr10927751pji.21.1664786268490; Mon, 03 Oct 2022 01:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664786268; cv=none; d=google.com; s=arc-20160816; b=pwk1pZFgaJDWWTvLmcqKfsmjCKkRW/ubZW55BSb4oyPypqU8KhvjSka/p8mnU5WYd/ BIYaeSOTqkY96EWnASLOncaOHHHvzhIiQSSrMTSD6bKyngzHPLvFO30TmPVIKJqWWwLj QrMYNQUaTp+cjsufiUZbEazfRIOQFkTiYpe7+zl24X5i9HI7t8CoFBrsA2Asqn8K7foL /yQ7xOupIax4BZo/+G3UH7V9tX+5ucjb90m80ncIkMroIXAzWykUY6V2bmZcE5nyFjl8 4gpynTl1gyNC1tj7SdJ5x3goZLMjoHXnjSfPZSEc/JonfLbmdv9/p8BZ7ES/fW//M/Gt Ckxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7bspsmd9IMRuwGaeUz23LCgtyhfeTfDTOPOqx0F87ns=; b=IIInjYDtkORMEHQN9aiei6xY+mvyVW41xFRr9yI30fj2JWQS8o//76CohluGq0xrM9 3V0q9FkLkNo/9rDfq+o6jDCPnl3XeGFleyu4SAWTM4DvsKnoAoc1YTE7M+HoWtpKE46E n8cvoaRku0qWDd/bsmCdxJ3COTcBHKYLfbxhCSKoTeSPUhzjPakiz+C+1zyiEq976IYQ zEJVWU5OGEn1iHTE6Wyqv2iEUY2qpIxs5jdKA9OqVMl4rXQo55RaiI9R1WBenw21DSiI EWlIFO9JQ+kED3ojOsfvszugz0sqWPqQVbF2iQiZ0KlPZ9CClj9EjFPAwAnDQ6rK0pqE Z7aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DXgeseml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi5-20020a17090b1e4500b001fd81d07d0esi9590892pjb.123.2022.10.03.01.37.37; Mon, 03 Oct 2022 01:37:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DXgeseml; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231524AbiJCHfN (ORCPT + 99 others); Mon, 3 Oct 2022 03:35:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbiJCHdp (ORCPT ); Mon, 3 Oct 2022 03:33:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66FB85282C; Mon, 3 Oct 2022 00:21:45 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 90BDF60FC0; Mon, 3 Oct 2022 07:20:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5197C433D6; Mon, 3 Oct 2022 07:20:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664781626; bh=HzWNp5YyPkS2fPfnmk/Ug6wOXveeiRA34eO/DWm4nXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DXgesemlC4WATjnKp0Ae25DSKO70gECkIlNeBNk0yrgoFBRBH+PsfJ7s2E0Yb3kGN e2KZWrXCqkh29f/aJ9VCdUfhta6GYW2Aye7ZexMLUdDXF3ExTVerJTG/uJ0uvMLyB0 94feN8KTgA0CA7kRel0hhtz5BpjNk/jxCThCg4fU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wang Yufen , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 64/83] selftests: Fix the if conditions of in test_extra_filter() Date: Mon, 3 Oct 2022 09:11:29 +0200 Message-Id: <20221003070723.602603564@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221003070721.971297651@linuxfoundation.org> References: <20221003070721.971297651@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Yufen [ Upstream commit bc7a319844891746135dc1f34ab9df78d636a3ac ] The socket 2 bind the addr in use, bind should fail with EADDRINUSE. So if bind success or errno != EADDRINUSE, testcase should be failed. Fixes: 3ca8e4029969 ("soreuseport: BPF selection functional test") Signed-off-by: Wang Yufen Link: https://lore.kernel.org/r/1663916557-10730-1-git-send-email-wangyufen@huawei.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- tools/testing/selftests/net/reuseport_bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/reuseport_bpf.c b/tools/testing/selftests/net/reuseport_bpf.c index b5277106df1f..b0cc082fbb84 100644 --- a/tools/testing/selftests/net/reuseport_bpf.c +++ b/tools/testing/selftests/net/reuseport_bpf.c @@ -330,7 +330,7 @@ static void test_extra_filter(const struct test_params p) if (bind(fd1, addr, sockaddr_size())) error(1, errno, "failed to bind recv socket 1"); - if (!bind(fd2, addr, sockaddr_size()) && errno != EADDRINUSE) + if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE) error(1, errno, "bind socket 2 should fail with EADDRINUSE"); free(addr); -- 2.35.1