summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>2018-07-03 15:42:49 -0700
committerDavid S. Miller <davem@davemloft.net>2018-07-04 22:30:27 +0900
commitbc969a977880511057053642a81371196303ca01 (patch)
treeb7340f31fc5705adefd32a92fe25c777c52f1bc6 /net/ipv4/ip_output.c
parent80b14dee2bea128928537d61c333f24cb8cbb62f (diff)
downloadlinux-bc969a977880511057053642a81371196303ca01.tar.gz
linux-bc969a977880511057053642a81371196303ca01.tar.bz2
linux-bc969a977880511057053642a81371196303ca01.zip
net: ipv4: Hook into time based transmission
Add a transmit_time field to struct inet_cork, then copy the timestamp from the CMSG cookie at ip_setup_cork() so we can safely copy it into the skb later during __ip_make_skb(). For the raw fast path, just perform the copy at raw_send_hdrinc(). Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 188cc586e7ff..570e3ebc3974 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1154,6 +1154,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
cork->tos = ipc->tos;
cork->priority = ipc->priority;
cork->tx_flags = ipc->tx_flags;
+ cork->transmit_time = ipc->sockc.transmit_time;
return 0;
}
@@ -1414,6 +1415,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
skb->priority = (cork->tos != -1) ? cork->priority: sk->sk_priority;
skb->mark = sk->sk_mark;
+ skb->tstamp = cork->transmit_time;
/*
* Steal rt from cork.dst to avoid a pair of atomic_inc/atomic_dec
* on dst refcount
@@ -1551,6 +1553,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
ipc.tx_flags = 0;
ipc.ttl = 0;
ipc.tos = -1;
+ ipc.sockc.transmit_time = 0;
if (replyopts.opt.opt.optlen) {
ipc.opt = &replyopts.opt;