Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp734712pxb; Tue, 5 Apr 2022 20:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz11wZVnY1gbcQyl8pbw2nY7KvuhXVi11WvLW+D+CamHxTmrMffjURCQwPGZMnDDlzeTog7 X-Received: by 2002:a63:4602:0:b0:381:f916:9312 with SMTP id t2-20020a634602000000b00381f9169312mr5624760pga.473.1649217472250; Tue, 05 Apr 2022 20:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649217472; cv=none; d=google.com; s=arc-20160816; b=knisF4OopzWN8fUkj7dwfUq0JEWRJaYkNfyVHr3Y7yS3q1ed/I8oZAG5Afqbdvw6sX Vh+KZcA/TDwXUgo66utcyfyilIWj5f30l2SI1jvDsfrpwv2FVc0ZXD9n+xt4uXCSqgAn MqdXMFNG5pD/lq1LPii4Z46k3tgablnqnVsmOvFjetqVBfefAJqbI6NJkzuE1v9GH8NE XE3PIRFSKE+fO2v9qf/JwL+risY0ttBdTYhR4HlB+b/LMb4xGmfqaRjGDMhqiVuWTwcl gJixlTm49h8MJLpHC3jgbIw5Msi/FzRms9Pcr504oCKU3UZXDyENS1IPTf++Z+y10Z60 XBCg== 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=AMgNW9v1UZS9Sljs2m2MIt9lOLvMDvyXrb3nwLis+ntxF9iU2GojxBR6xnFJUvilYn yTP3knQ0aLkBugxPdwdTfBOAAcUXE7WmBzzGiUsPKb86nPS0NJobUkqQLdjGHKALzlX3 +uOTUpN/0ohmGQJhqklG3j1ZcSfOBMtf/awNNLqkqO4F34BVeUp8uwGRkr4obXY9fcru ZJ3ezk2z/8mveMzCPmdJYDB5gFqz2WSD8AWvUWcHGC4Fl055c9JWNLL2zO0XmyugiyNg DaVgKGM+jxIj/DvY12x7kc3GWwqYSLBXBARDQFzGlhHW6j+S2gblttQ6hvC9qcfgeKom 6U5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gcJab2+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h13-20020a056a00230d00b004fa7c4d3815si15916598pfh.73.2022.04.05.20.57.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 20:57:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gcJab2+6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0EB5D354D03; Tue, 5 Apr 2022 20:38:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350046AbiDEUCV (ORCPT + 99 others); Tue, 5 Apr 2022 16:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348907AbiDEJsp (ORCPT ); Tue, 5 Apr 2022 05:48:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92255ECC6B; Tue, 5 Apr 2022 02:37:09 -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 36CF6B81B14; Tue, 5 Apr 2022 09:37:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 975C7C385A0; Tue, 5 Apr 2022 09:37:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151427; bh=5ViWBbsLPxdn3zqyYlQXpfb56RiI3TzY2TRM9WAalvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcJab2+6MJauQH9NG3L9xvgEO5wS5VbhAd2hAEiRJaq+thy88okY6DKySYb1i4OrI I2iRGYAldj9QnNN8X603jwSibs6TwXNKR4wk1bqA0Hls0Pk0RPN6NOaZMAxoMldmev BTTcavTAbawP8pp3PC/0u4hykLul9+0sOtdTfBfQ= 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.15 409/913] selftests/net: timestamping: Fix bind_phc check Date: Tue, 5 Apr 2022 09:24:31 +0200 Message-Id: <20220405070352.105680077@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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