Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3176277pxb; Mon, 18 Apr 2022 18:09:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8R+Xc3WG5+4d5WuMZxEnpazOKy4j8NjQJJFpEuEktsoE0WPQXo79anBKtgiWwfKDerhCj X-Received: by 2002:a05:6402:442:b0:416:14b7:4d55 with SMTP id p2-20020a056402044200b0041614b74d55mr14695837edw.183.1650330577438; Mon, 18 Apr 2022 18:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650330577; cv=none; d=google.com; s=arc-20160816; b=bM8JpJedm0uvfOdTuaEj5Vs+HOBv9Yo975BqwZhk2mCL6FybEyFcIlwqZoJ7D3PCkU uO5SBX5HB3IWEXgW6LUJmqlkM1KGug8OIco2hUaieY/OJWg2e4tzgQHofNMAJ02KHXXU OyZCOBwqvsEJGJWLfY7AHrSTIeIrZtFrZxmIaONV/6EPvRPJJ/qEBfBQBxFj7ZK26S8n 0v1PYIqv7u172wqEBJwYWGBV+P5r3Gb1j05VjVpGRrhMHta3twJu9U+wNuaE5jqL7nyd CsffOnSU5zwIaOLq9yAWQSJncOxDGAFRyD7+9dv40SL9s04b1P5E6xN9FiT43BWXFFLV L3jw== 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=xaQikfBIHWn8EWgZFxl8BdEOXpjYlPxt1H41biqmmK8=; b=aarmDr4EADjarsbp0UNEfRmvB6EHgtVVW+Lw2R+q4caHq75OyqvF/0vhE9RzirWJFJ AG8FVWRtVAiVxPv9HTPktUAOjDkv8PGH4DgrXWSbcSMrVKe/9GxbV0gCKqKWAp1VXSvP NX01D3+Za1Z8A9l7s2w9uCOIq2koel7Z4KJZk0BdqyXyQWs3W4mDu12EhhNXHN/7VRKV Q14zAXD9VVHw9z+dQHXV5ThYd/50qru3x6turmqsSv2aktBHQDN65OZ0cnERQsBvL3oD 72Hwi6Faw4rqdxJi9KcuvSHwvz5k9poh4LYuxCyxFS2W+rrI3fDBwrXKNkGYeB4jY+sJ lkMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gMSA9RsT; 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 gz25-20020a170907a05900b006e8746614ccsi7122359ejc.717.2022.04.18.18.09.14; Mon, 18 Apr 2022 18:09:37 -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=gMSA9RsT; 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 S245008AbiDROBq (ORCPT + 99 others); Mon, 18 Apr 2022 10:01:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243535AbiDRNlW (ORCPT ); Mon, 18 Apr 2022 09:41:22 -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 A4ED02FFE9; Mon, 18 Apr 2022 05:59:21 -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 177C6612E4; Mon, 18 Apr 2022 12:59:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B9D8C385A1; Mon, 18 Apr 2022 12:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286759; bh=wkWfM70BODSDCl/XojrcBlfzYnjeTE+/YGugU8Xmf+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gMSA9RsT4C6zI/DHCZQM6uceu4wTyJzQyVyDKjPFqf37QIVYsW2BO/XTF4XJ6SVkB dCFf9RlBQfLeMu5JkBIq5YaJKiQnc/mYaxVmtc/NXqiYmcPkHzIq4V02sPoUXyI2HG Qf92YV+v8Tm8tXqpun+IOt61hCRnxU3tFvJPauwg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Willem de Bruijn , Soheil Hassas Yeganeh , "David S. Miller" , Vladimir Oltean , Sasha Levin Subject: [PATCH 4.14 236/284] ipv6: add missing tx timestamping on IPPROTO_RAW Date: Mon, 18 Apr 2022 14:13:37 +0200 Message-Id: <20220418121218.423694271@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@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.7 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: Willem de Bruijn [ Upstream commit fbfb2321e950918b430e7225546296b2dcadf725 ] Raw sockets support tx timestamping, but one case is missing. IPPROTO_RAW takes a separate packet construction path. raw_send_hdrinc has an explicit call to sock_tx_timestamp, but rawv6_send_hdrinc does not. Add it. Fixes: 11878b40ed5c ("net-timestamp: SOCK_RAW and PING timestamping") Signed-off-by: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller Signed-off-by: Vladimir Oltean Signed-off-by: Sasha Levin --- net/ipv6/raw.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 3d9d20074203..f0d8b7e9a685 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c @@ -622,7 +622,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length, struct flowi6 *fl6, struct dst_entry **dstp, - unsigned int flags) + unsigned int flags, const struct sockcm_cookie *sockc) { struct ipv6_pinfo *np = inet6_sk(sk); struct net *net = sock_net(sk); @@ -659,6 +659,8 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length, skb->ip_summed = CHECKSUM_NONE; + sock_tx_timestamp(sk, sockc->tsflags, &skb_shinfo(skb)->tx_flags); + if (flags & MSG_CONFIRM) skb_set_dst_pending_confirm(skb, 1); @@ -945,7 +947,8 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) back_from_confirm: if (hdrincl) - err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, msg->msg_flags); + err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, + msg->msg_flags, &sockc); else { ipc6.opt = opt; lock_sock(sk); -- 2.35.1