@@ -115,6 +115,7 @@
#include "udp_impl.h"
#include <net/sock_reuseport.h>
#include <net/addrconf.h>
+#include <linux/posix-timers.h>
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;
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 <jesus.sanchez-palencia@intel.com> --- net/ipv4/udp.c | 5 +++++ 1 file changed, 5 insertions(+)