Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7105552rwi; Mon, 24 Oct 2022 09:53:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4w0lnapcn7iJKLAbGVZZ4ndNf5eHKcj4/hw9I7S5IPTH/GBqij2odjfEN3rD9/sqa7fYHn X-Received: by 2002:a17:907:3e01:b0:730:a690:a211 with SMTP id hp1-20020a1709073e0100b00730a690a211mr28205788ejc.596.1666630397202; Mon, 24 Oct 2022 09:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666630397; cv=none; d=google.com; s=arc-20160816; b=GH0VuP9bVmbGL69+FoG/Z6zTc+QVDvCTkfnqWEHisZfWxiqyyGcEqsKDUCnMMiT81q 6q5WkXH7WGzPAHtNDBvvk2/EB6+G2lnal+/8qH3ZOw8Y76OiR79LaLrLoPCcyfO/EBNX w9Yt742jqK8A4xqZnh1FSsSeWu0DQ4LU6/Dao+TQyvrNIblUjXqnnNVCMYefYdiykU82 WxyMgOZFgtGn4Jde2NpsyoF74QUvVXrSGB2a25dEv9puPOBX37bwcRPV1GkAxU48ptH5 r8ksLjRU6yzTtzrsATASFZgbmdrg9KwMHAjfVfkn13+RZ5PXCQlAOzeKjaedYwLdBl5Y f29w== 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=EW3/KLZbHlwOE43KfGEcMeLhV3kJrvB/OJHc/V6VHfMZ2mp8mjSmKorTsN8EYFSnZN msf86ya/g6GMsQ+cIVzPx/cIWtKwiE8C2+Bf1XpA0e1H9JAKvs8WAD2kNwT18FjE2obu C+jn3QwNlK9FMN1RwUAt7YhaxnOXhkzHWbMVdgDcPvTGVZCTi0LVmx1YH4HZKf5QJCDD UPq6Pb8lOtmYMBJqhL//L2I8qYiEOchER9jbWcByRfZ8mNEvr+1VIY6Q4WJnwu67mRvT YYQAKAmbPsLXawYBFQp0kUj9JgwvNVRWdobWZ4cBc6hMCtF7BWcymJCqKY2FZX1OyOjh 9t5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ELWA4Ha6; 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 f19-20020a170906495300b0077951929340si210947ejt.271.2022.10.24.09.52.52; Mon, 24 Oct 2022 09:53:17 -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=ELWA4Ha6; 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 S230510AbiJXQCh (ORCPT + 99 others); Mon, 24 Oct 2022 12:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbiJXQBW (ORCPT ); Mon, 24 Oct 2022 12:01:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E360F111B8A; Mon, 24 Oct 2022 07:55:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id B5E88B8117A; Mon, 24 Oct 2022 11:46:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FBA1C433C1; Mon, 24 Oct 2022 11:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611959; bh=HzWNp5YyPkS2fPfnmk/Ug6wOXveeiRA34eO/DWm4nXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ELWA4Ha6abEBOyxhxgjeaVsVuH1Lfi8y7ygCG0Gfr9qwnQCcoXZxgJtEHvbhqOw+A Bxl9m01hGCaEqjG/vWPYroIGSWe+oGmVF1UC2ndSfJgTk4uaU6bUpf3W7eTbrIe8P/ aeIb8scTrusiyyR8UWRJ/hSekqvef1b2TZzd4dik= 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 4.14 017/210] selftests: Fix the if conditions of in test_extra_filter() Date: Mon, 24 Oct 2022 13:28:54 +0200 Message-Id: <20221024112957.496846444@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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.6 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