From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesus Sanchez-Palencia Subject: Re: [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time. Date: Tue, 23 Jan 2018 10:12:39 -0800 Message-ID: <83af0ace-d5ed-0b82-f289-f0d2dd0e669e@intel.com> References: <20180117230621.26074-1-jesus.sanchez-palencia@intel.com> <20180117230621.26074-2-jesus.sanchez-palencia@intel.com> <20180118171122.3pnrws3o3dvh54u2@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, vinicius.gomes@intel.com, intel-wired-lan@lists.osuosl.org, anna-maria@linutronix.de, henrik@austad.us, tglx@linutronix.de, john.stultz@linaro.org, andre.guedes@intel.com, ivan.briano@intel.com, levi.pearson@harman.com, Richard Cochran To: Richard Cochran Return-path: Received: from mga14.intel.com ([192.55.52.115]:50055 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751547AbeAWSOF (ORCPT ); Tue, 23 Jan 2018 13:14:05 -0500 In-Reply-To: <20180118171122.3pnrws3o3dvh54u2@localhost> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/18/2018 09:11 AM, Richard Cochran wrote: > On Wed, Jan 17, 2018 at 03:06:12PM -0800, Jesus Sanchez-Palencia wrote: >> @@ -2130,6 +2137,15 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg, >> sockc->tsflags &= ~SOF_TIMESTAMPING_TX_RECORD_MASK; >> sockc->tsflags |= tsflags; >> break; >> + case SO_TXTIME: >> + if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) >> + return -EPERM; >> + if (!sock_flag(sk, SOCK_TXTIME)) >> + return -EINVAL; >> + if (cmsg->cmsg_len != CMSG_LEN(sizeof(ktime_t))) >> + return -EINVAL; >> + sockc->transmit_time = *(ktime_t *)CMSG_DATA(cmsg); > > As pointed out in the first series' review: > > No guarantee the CMSG is properly aligned on arches that might trap > on unaligned access. Yes, it will be fixed on the next version. We should probably fix the other cases on this function as well then. Thanks, Jesus > > Thanks, > Richard >