From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com ([134.134.136.24]:56493 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932905AbeCGBPC (ORCPT ); Tue, 6 Mar 2018 20:15:02 -0500 From: Jesus Sanchez-Palencia To: netdev@vger.kernel.org Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, vinicius.gomes@intel.com, richardcochran@gmail.com, intel-wired-lan@lists.osuosl.org, anna-maria@linutronix.de, henrik@austad.us, tglx@linutronix.de, john.stultz@linaro.org, levi.pearson@harman.com, edumazet@google.com, willemb@google.com, mlichvar@redhat.com, Jesus Sanchez-Palencia Subject: [RFC v3 net-next 10/18] net: ipv4: udp: Handle remaining txtime parameters Date: Tue, 6 Mar 2018 17:12:22 -0800 Message-Id: <20180307011230.24001-11-jesus.sanchez-palencia@intel.com> In-Reply-To: <20180307011230.24001-1-jesus.sanchez-palencia@intel.com> References: <20180307011230.24001-1-jesus.sanchez-palencia@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: Initialize clockid to CLOCKID_INVALID instead of 0 (i.e. CLOCK_REALTIME), and copy both drop_if_late and clockid from CMSG cookie into skb. Signed-off-by: Jesus Sanchez-Palencia --- net/ipv4/udp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index d683bbde526b..4bea8d5ab968 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -115,6 +115,7 @@ #include "udp_impl.h" #include #include +#include struct udp_table udp_table __read_mostly; EXPORT_SYMBOL(udp_table); @@ -927,6 +928,8 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) ipc.sockc.tsflags = sk->sk_tsflags; ipc.sockc.transmit_time = 0; + ipc.sockc.drop_if_late = 0; + ipc.sockc.clockid = CLOCKID_INVALID; ipc.addr = inet->inet_saddr; ipc.oif = sk->sk_bound_dev_if; @@ -1043,6 +1046,8 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) err = PTR_ERR(skb); if (!IS_ERR_OR_NULL(skb)) { skb->tstamp = ipc.sockc.transmit_time; + skb->txtime_clockid = ipc.sockc.clockid; + skb->tc_drop_if_late = ipc.sockc.drop_if_late; err = udp_send_skb(skb, fl4); } goto out; -- 2.16.2