Thread (43 messages) flat view 43 messages, 8 authors, 2018-02-13

Re: [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time.

From: Richard Cochran <richardcochran@gmail.com>
Date: 2018-01-18 17:11:26
Also in: intel-wired-lan

On Wed, Jan 17, 2018 at 03:06:12PM -0800, Jesus Sanchez-Palencia wrote:
quoted hunk ↗ jump to hunk
@@ -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.

Thanks,
Richard
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help