From patchwork Mon Oct 24 11:29:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp403984wru; Mon, 24 Oct 2022 04:53:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rLAMT0MH6mOFei+X0m9+pdrgFHKfbkc8JfZyLM3+yQ4g7BKRvnhHygUwKXNI703+DI5g9 X-Received: by 2002:a63:5a1b:0:b0:461:9934:6f62 with SMTP id o27-20020a635a1b000000b0046199346f62mr27958046pgb.266.1666612438693; Mon, 24 Oct 2022 04:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612438; cv=none; d=google.com; s=arc-20160816; b=nWuWEh6oiQjmgIDmcnh14dfJMQWcy8SAV2Us6zig15JLPG+NKH/2n0zkDFMi/3hRdt YKCVEQgHuUhT3B6DPL+CEY7xTfr+vyxugFmKWJSYd+47/n5AJ3dEWFkBKuhWy3R/JgOB ltOm3pYJmlu3sALAWbfSekRsdtHJalcj7q22WKHcsXqTpZ3hWdyTu58CS+owO7fbyxJX 0piAI0vDWKDGtqVaxK+Fg0Y44PYe+HVq708B56nAjYbWs3SCBI1UGU8pCBT1qk5m/ckF iZpqaCWNsre/NOViLBUCiwLELVLd3SpxO3MucGF2vXSd/S/VoiQfuhjkQTnfmJPGOF3T QXKA== 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=zukwGx+8Cu6JLiVRuQC7CBsi3f/fLxQB7XI/l043YTAkRfClaNti9re7KrRm8dr9Me H+JMyDNG4BoEiOqcs8a9+NBPPqVkFV3EOiXaUs6eTTs4g76+d2kSIf4nGoWqwTz6+Cc4 BEyS5V6ZuJFMle515IIcxI471pN4WkwHIk7TK8dOpFp5oYNBgmB5gRxTDdsnxMhaeVN9 H+dVZMqFQF6eKPuDYCp1uS6XKger7dbB+3tI2l+ZRIfq4ISIi/6Smyc1zlU5+bMPne4d USqLqqjzQtOVT5HkpVGhE1SGC9YIf0UutByt/BMBcx29lngHGC87oyxAPwjAMATq0tW1 1+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sCKE+p5k; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 63-20020a630342000000b0043c700feb0dsi34268908pgd.160.2022.10.24.04.53.45; Mon, 24 Oct 2022 04:53:58 -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=sCKE+p5k; 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 S231721AbiJXLxO (ORCPT + 99 others); Mon, 24 Oct 2022 07:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbiJXLwj (ORCPT ); Mon, 24 Oct 2022 07:52:39 -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 2117628E03; Mon, 24 Oct 2022 04:44:49 -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 2B0B1B81132; Mon, 24 Oct 2022 11:38:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4874CC433C1; Mon, 24 Oct 2022 11:38:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611526; bh=HzWNp5YyPkS2fPfnmk/Ug6wOXveeiRA34eO/DWm4nXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sCKE+p5kr8h9mlKhHk2Q2iFStyE8ZUPFNMqZgLbvRLBi3e85PbIviP/fH0a+E4CZ5 tqrrKSMj8bDkK4MvXdcNrbaoIFhtqTmeX9PuSVZBnI5csCKJ/uoJEKxUl6fUeQ2m8x /5uqRrEhLs/YuEEb15fiqD5UpDALmOXewv8daghc= 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.9 013/159] selftests: Fix the if conditions of in test_extra_filter() Date: Mon, 24 Oct 2022 13:29:27 +0200 Message-Id: <20221024112949.837857514@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747569804838900756?= X-GMAIL-MSGID: =?utf-8?q?1747569804838900756?= 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);