Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp684407pxb; Tue, 5 Apr 2022 18:41:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHTVGSsuxWcciISuBWFpp9dZ1DRbum+GT4KUeypDdFs2I8M8vZXlVLFxAjhAgw7IE/imZ+ X-Received: by 2002:a17:906:a219:b0:6e4:86a3:44ea with SMTP id r25-20020a170906a21900b006e486a344eamr6251035ejy.385.1649209303760; Tue, 05 Apr 2022 18:41:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649209303; cv=none; d=google.com; s=arc-20160816; b=QUT7H+rKcW+5+Z/wx+YsEu1V6jNVKn2+kFFoSpBwgd319sH/JM21Z3QRXIkgVMBwMi FpfHcsKrhE5NdL+5NSyeDES8bjSmPAwhdv5poY3JhIRo4Q6g9M690Uj+ieIzv1IIS2b8 9IbQvppmgFVa/ev8IGc9EUk9IGCU4oaQz3zwqgoM/j2l4vNuIoZlcO5DiIJWYWjecLZC AKdHEMuDJqZ33GHPaZbpR5LH8y7uYg+TAZ/inV1axCHP3YljHzrWE5FzRTXui7bc5lWo D9jOM6k8dY3ybHdzwgXP2UgHUfGducZpjAnpYowLMuaJMsiPA6UIxaTk2sv0rfdv9bdj s5ag== 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=SoP9HSs/l9szuq6ZvW+A0VVfi1TrUU/LKhFNExCMMXU=; b=DohjNOgeGDJ5PYTqVlrNrIC3LHTJYCR0zLYPfFAuMJrdoU+By/pZ32Zx09kpcj0zLU W55QkIM3dfqH0hxmjZnTj3JRsUUbdU93x1Ga/gjFkZi8cRecLaGPVsjm5H30YdhNipNi l/VThSE9TUCQavHcLWMWjWQPy/wHGO/CoLwBbqWv3X6Y1AmopNLVHYUodA51JfsOrGLl 6CCeN/Q+gqWFmh+0PWHkPqYyqLl0XlVyotU+C9OfVDSHvwyp43H2bfj+fhJNT1IqGAM4 k6koWIklkMNpQQidQZijHhDzci/Qv4t7fIFvwxBDT5twHqlLaDjTJbNxvH/Uzi27sobH 5yyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gXMn3Dgh; 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 u20-20020aa7d0d4000000b0041cbe834f81si6345101edo.581.2022.04.05.18.41.18; Tue, 05 Apr 2022 18:41:43 -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=gXMn3Dgh; 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 S237631AbiDEIm6 (ORCPT + 99 others); Tue, 5 Apr 2022 04:42:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbiDEICa (ORCPT ); Tue, 5 Apr 2022 04:02:30 -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 BF12254FA9; Tue, 5 Apr 2022 01:00:32 -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 55D446177F; Tue, 5 Apr 2022 08:00:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E087C34110; Tue, 5 Apr 2022 08:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145631; bh=5ViWBbsLPxdn3zqyYlQXpfb56RiI3TzY2TRM9WAalvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gXMn3DghpYyPV/BB/aGRtvB/iul++SpI/BGgowFWnmHSSEIOmN8qASfHljD6HBNOH 4fJM7dIzwhSsD7wG2vKXAxKZ6lXbJ2Gd477K2BZoCeIRzuHc18/SHOnd5ip2WkwQ/I um9eRkRZiw9PQrybWuL1mFCJFs5RxW4a9BpVeydU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gerhard Engleder , "David S. Miller" , Sasha Levin Subject: [PATCH 5.17 0474/1126] selftests/net: timestamping: Fix bind_phc check Date: Tue, 5 Apr 2022 09:20:21 +0200 Message-Id: <20220405070421.539916834@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 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,T_SCC_BODY_TEXT_LINE 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: Gerhard Engleder [ Upstream commit 678dfd5280341d877ca646499bfdc82a3d8b4356 ] timestamping checks socket options during initialisation. For the field bind_phc of the socket option SO_TIMESTAMPING it expects the value -1 if PHC is not bound. Actually the value of bind_phc is 0 if PHC is not bound. This results in the following output: SIOCSHWTSTAMP: tx_type 0 requested, got 0; rx_filter 0 requested, got 0 SO_TIMESTAMP 0 SO_TIMESTAMPNS 0 SO_TIMESTAMPING flags 0, bind phc 0 not expected, flags 0, bind phc -1 This is fixed by setting default value and expected value of bind_phc to 0. Fixes: 2214d7032479 ("selftests/net: timestamping: support binding PHC") Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- tools/testing/selftests/net/timestamping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/timestamping.c b/tools/testing/selftests/net/timestamping.c index aee631c5284e..044bc0e9ed81 100644 --- a/tools/testing/selftests/net/timestamping.c +++ b/tools/testing/selftests/net/timestamping.c @@ -325,8 +325,8 @@ int main(int argc, char **argv) struct ifreq device; struct ifreq hwtstamp; struct hwtstamp_config hwconfig, hwconfig_requested; - struct so_timestamping so_timestamping_get = { 0, -1 }; - struct so_timestamping so_timestamping = { 0, -1 }; + struct so_timestamping so_timestamping_get = { 0, 0 }; + struct so_timestamping so_timestamping = { 0, 0 }; struct sockaddr_in addr; struct ip_mreq imr; struct in_addr iaddr; -- 2.34.1