Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754042AbdIRPS7 (ORCPT ); Mon, 18 Sep 2017 11:18:59 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35199 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420AbdIRPS4 (ORCPT ); Mon, 18 Sep 2017 11:18:56 -0400 X-Google-Smtp-Source: AOwi7QCeL9YTUjHl2falIPXZa+1m5kLlTsRyZyz3OJZcwHzxSPzm96s3JKNFeTbEBB7vAoanURxHiA== Message-ID: <1505747934.29839.21.camel@edumazet-glaptop3.roam.corp.google.com> Subject: Re: [PATCH RFC V1 net-next 1/6] net: Add a new socket option for a future transmit time. From: Eric Dumazet To: Richard Cochran Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Andre Guedes , Anna-Maria Gleixner , David Miller , Henrik Austad , Jesus Sanchez-Palencia , John Stultz , Thomas Gleixner , Vinicius Costa Gomes Date: Mon, 18 Sep 2017 08:18:54 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 504 Lines: 19 On Mon, 2017-09-18 at 09:41 +0200, Richard Cochran wrote: > + case SO_TXTIME: > + if (!sock_flag(sk, SOCK_TXTIME)) > + return -EINVAL; > + sockc->transmit_time = *(u64 *)CMSG_DATA(cmsg); 1) No guarantee the CMSG is properly aligned on arches that might trap on unaligned access. 2) No guarantee user provided 8 bytes here. Also, what would be the time base here ? > + break; > /* SCM_RIGHTS and SCM_CREDENTIALS are semantically in SOL_UNIX. */ > case SCM_RIGHTS: > case SCM_CREDENTIALS: