From patchwork Tue Jul 19 05:40:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9235925 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4846E6075D for ; Tue, 19 Jul 2016 05:41:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A3CA20587 for ; Tue, 19 Jul 2016 05:41:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EB3B269E2; Tue, 19 Jul 2016 05:41:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84D4B20587 for ; Tue, 19 Jul 2016 05:41:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752174AbcGSFlF (ORCPT ); Tue, 19 Jul 2016 01:41:05 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:26140 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752049AbcGSFlC (ORCPT ); Tue, 19 Jul 2016 01:41:02 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 19 Jul 2016 14:41:00 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 8BC3941236; Tue, 19 Jul 2016 14:41:00 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 77F302806E; Tue, 19 Jul 2016 14:41:00 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 7271B2806D; Tue, 19 Jul 2016 14:41:00 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id QBD26706; Tue, 19 Jul 2016 14:41:00 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="215878864" Received: from mail-sg2apc01lp0243.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.243]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 19 Jul 2016 14:40:59 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6jFlqI0paFS4+9auCuDDqsmtH0hFTiWaXyx9ln/yPjA=; b=JqdeGMm3w/+KkY3GoM0Ro4eAfzVFKkm76Vrt80kFZKmjBSSMM/yhIsmFOYfV5AXKjnH803LsiMKAMtswUeESKLVSOIu5wHadz+jfuRGTw339Oo60bt3V5tXqleIwIFYKUm4c41GrvOqzR7aRMlL+mRSbKD/TpjeS28Jsxmjp7KM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.144) by HK2PR06MB0548.apcprd06.prod.outlook.com (10.161.183.153) with Microsoft SMTP Server (TLS) id 15.1.539.14; Tue, 19 Jul 2016 05:40:57 +0000 From: Yoshihiro Shimoda To: CC: , , , , , , , Yoshihiro Shimoda , Subject: [PATCH v3] packet: fix second argument of sock_tx_timestamp() Date: Tue, 19 Jul 2016 14:40:51 +0900 Message-ID: <1468906851-8424-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0041.jpnprd01.prod.outlook.com (10.164.162.151) To HK2PR06MB0548.apcprd06.prod.outlook.com (10.161.183.153) X-MS-Office365-Filtering-Correlation-Id: 188f426c-a7b0-4a16-a206-08d3af974225 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 2:yUfpLiW2wr073y+BfYyYkUMch17ppgjr2ImRWQZ1zt0Bi7ESsppABjJwa09owBiE6N6QYyjlBFvV17Nq/5c79Z0Je4IeFR0cEd8oRNbG29JN2LtctbUXN0BUf0SEgjgQ791CmlqZjdMa1/mBYVe7DMuRUyiw+CZp8RSkkKpYN52G0BfBJv11wIKVDKl3hp5c; 3:5Suo8klumGN6rwQT1E6KCleED+ZYv7TJqNFs64rwuMCyqex22CuikMaD8610U31gguysfC6sadjWCxC5lM45vK1jriE/kuounA1YsawPdkjdGn4jtHlfMkxMucHwjk5B X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0548; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 25:xLPfzHC2WIIv2TH5llf662S2PTqAzNeeixQcBvSz84D5/2FwRoXULng27YH65evF1QMBlBMnuywsBi4cWiZi9T/ZD5lFwEz7/3tRVqebX+S887dwvicC/5nO6HUMtlwC1UAIikxSu/vGtSCMH4RDUEOgV0AqYx+8Qu648qOECD/KOONuRj6jd1AksixCmUQjvrhfRxazDMjRpwPJsj8quDr5aQbVSgcDNs5stcDv/UB2B145hs90vqqrKWUVYq1nGajtQn8GQn7YSHdYbtwI2azGrw56TSy7IXPHDty4SJf2DXjgJWAt9wVXcivxBhS+PxBaxUcH3fp+ykprax1zsrlVRv6riQVaxJtwleJnWHToq+xB1klVKIyewoZkmhQ2huvE5z74s66RPslOzeCpMHti05nnMoUU1Fy/9PSz/wMx/mM2o3AT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dp2c8njONJCQA6vmLsTmmRo0QluYW9BVu0q9TRobtfcmtU5p4Tjw4DIeH74B/I5yrKb0Ua7EXVGyb6B7TWAu0TQeCbdvkjcLPEZP1YrGaFLUGcrKH0lvm4c3HzMHIPq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:HK2PR06MB0548; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0548; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 4:N2/WpZPXjG9n4olulypFStvUhQJxkZBaL/ID3RkthkQPY80WJzP/NcOUmZPHo1eqfHLBVdy5q57IwyJxzdWCVRael3tTrQlBR46u5+c9O38Tei1SoavSBkeb/c9Y0Pmmyvrok06CmkdtgFbtZd4MucfaAiab1R4EdYSzaId6nvSxqARiOkwK67VSk3G8+Lh3tseH00ymo7t4ZVGRG1fAV1M0CRQyLPn7zZpytxcymC/N/llv4vDYOKQx/FF141A3kk4COm6Wk6wj9lkw3p9AC8dM+/gydHQFsZxsOP7W6MmIBftu8X9Z+WsAzksYITKfxdOumSCPAnm2zLBuu29esQ7FvUzISLfkLEUF172RtGeJhtmZFfIwdqccsW2AMCFxsb2cesHqmAC9yCoSkV04cXi38Z+UEJPF+AoOvgkNR1rsVGRK6Bvxpftpw5wy3aqf X-Forefront-PRVS: 000800954F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(3846002)(50466002)(81166006)(6116002)(33646002)(92566002)(47776003)(105586002)(189998001)(106356001)(305945005)(7736002)(5003940100001)(68736007)(586003)(15975445007)(97736004)(78352004)(8676002)(229853001)(2351001)(2906002)(4326007)(42186005)(77096005)(101416001)(19580395003)(76506005)(50986999)(66066001)(48376002)(50226002)(36756003)(7846002)(110136002)(19580405001)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0548; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0548; 23:P5zbI2VboblFQCIDOAZSYxtK4dgtD3oapW4YiR58K?= =?us-ascii?Q?fb84swM9INp3F14ut/eWKHxzIvRaQAx5JTmDMKTZ7QOshi9BJ98dOssvudA+?= =?us-ascii?Q?zKHSLj6WGkWwvEf+Z379IK650LhBdVy0RJmnP2sP0LdxRNuzeEKQc4damkx/?= =?us-ascii?Q?U/T3MmovA5hXPOk+bIG6ORVEZ8uu+WmTgOgDFarfZrl3337arbK/TUMV6ksK?= =?us-ascii?Q?yRPnw7m4fdyoTsYFAN0wcMfRqBrkaFSBizcAIPXkYnpSkdwLh5KDgMtrqf3s?= =?us-ascii?Q?kLwHYwrW2Ttah4A8f8OCsG/sbw+Vel6FVK0KF2L6sGhVE7CYLpZz5ZJlj8zQ?= =?us-ascii?Q?JAt3OwWtjDslHjQMDpigXTyRNIuzNjCNgCBqo71y5uSS84oTdBN6dlI29iXk?= =?us-ascii?Q?uFJBVp3D8/ZZLfAx4bqR4LpP5ce6dhOo4QZAYjw6PJgtWDNVjLAJUAY3uzCo?= =?us-ascii?Q?IZu8kCLa4WG5vrDCRmSh2y8JAajckSkmH5cA1s8ckNOBEprU+5+qvi/bhSxz?= =?us-ascii?Q?NLH7ezt/BH8kaH3t7Ndq+0yT46Ni0OEIQ90LxR1xGTHeyeYB6R+hgjHxvz0q?= =?us-ascii?Q?nKauVoeLnN31g26VaselgNaEiq8oV8Y/za4O42w39l5Wkf8seyzyRPWGcZAV?= =?us-ascii?Q?BAK3e+nslGM4+4o+4QFlgsdtpwfjxwzRSqgRRshBiDY5DhNEWuvtw8gut9Hl?= =?us-ascii?Q?k3HqC0e6KD8IP7AJZAQf6icg6ZMLMLY6fyxCaW0x0fFDoPn94CtQMmhz3IcH?= =?us-ascii?Q?1wwdi1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IdYSaX/1ZnEMYpBmFUNPxsJQ84sMDoNjGEO0th+Mza7J5rM3Nel5VQIfyiuzLozjV74KMVnJ9FdoridTYfTZrRG5THM3DXdERbDmvAGr84O1zYmzFvs6sVVBqpg2nw57IUmC9ANoqBLMYdECCxGrCQadpIVZ9tQ2xgnyFgWSQbsLQwCEYI7sDRU6I5th0z/n1CKIfHVNqU3syo1X5E0xbLhwN7PS4BpAlNDvKesI2ulDP6RDTSV1aiA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0548; 20:K3eSPeqrFtzB0qu+anyF8XvkwCJx41mmmgwINeIgpU7rgweLneJq8X9PIZEDDTx+obGOpgKVpd7XaPkOi0hmZrJoYF/OBkQ3dzloDtz6JiB48sqBYxT9HlfvsSffdF2uNMIAOB2LcD3F4zscz+dX3NQN3EJZlyfKFdprmjMiv3s= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2016 05:40:57.1294 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0548 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes an issue that a syscall (e.g. sendto syscall) cannot work correctly. Since the sendto syscall doesn't have msg_control buffer, the sock_tx_timestamp() in packet_snd() cannot work correctly because the socks.tsflags is set to 0. So, this patch sets the socks.tsflags to sk->sk_tsflags as default. Fixes: c14ac9451c34 ("sock: enable timestamping using control messages") Cc: Reported-by: Kazuya Mizuguchi Reported-by: Keita Kobayashi Signed-off-by: Yoshihiro Shimoda Acked-by: Soheil Hassas Yeganeh --- Changes from v2: - Fix build error... Changes from v1: - Set socks.tsflags to sk->sk_tsflags as default instead of a condition. - Fix other socks.tsflags values in the af_packet.c. - Revise the commit log. About v1 (as RFC): - http://thread.gmane.org/gmane.linux.kernel.renesas-soc/5646 net/packet/af_packet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 9f0983f..53e87ce 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1927,7 +1927,7 @@ retry: goto out_unlock; } - sockc.tsflags = 0; + sockc.tsflags = sk->sk_tsflags; if (msg->msg_controllen) { err = sock_cmsg_send(sk, msg, &sockc); if (unlikely(err)) { @@ -2678,7 +2678,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) dev = dev_get_by_index(sock_net(&po->sk), saddr->sll_ifindex); } - sockc.tsflags = 0; + sockc.tsflags = po->sk.sk_tsflags; if (msg->msg_controllen) { err = sock_cmsg_send(&po->sk, msg, &sockc); if (unlikely(err)) @@ -2881,7 +2881,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) if (unlikely(!(dev->flags & IFF_UP))) goto out_unlock; - sockc.tsflags = 0; + sockc.tsflags = sk->sk_tsflags; sockc.mark = sk->sk_mark; if (msg->msg_controllen) { err = sock_cmsg_send(sk, msg, &sockc);