aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/raw.c
diff options
context:
space:
mode:
authorJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>2018-07-03 18:42:50 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-04 09:30:27 -0400
commita818f75e311c23cdac528888c60ae6e43a8958d0 (patch)
tree86aee5a99c979324a59233d0cb7445fcb933ce4a /net/ipv6/raw.c
parentbc969a977880511057053642a81371196303ca01 (diff)
net: ipv6: Hook into time based transmission
Add a struct sockcm_cookie parameter to ip6_setup_cork() so we can easily re-use the transmit_time field from struct inet_cork for most paths, by copying the timestamp from the CMSG cookie. This is later copied into the skb during __ip6_make_skb(). For the raw fast path, also pass the sockcm_cookie as a parameter so we can just perform the copy at rawv6_send_hdrinc() directly. Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/raw.c')
-rw-r--r--net/ipv6/raw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index afc307c89d1a..5737c50f16eb 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -620,7 +620,7 @@ out:
620 620
621static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length, 621static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
622 struct flowi6 *fl6, struct dst_entry **dstp, 622 struct flowi6 *fl6, struct dst_entry **dstp,
623 unsigned int flags) 623 unsigned int flags, const struct sockcm_cookie *sockc)
624{ 624{
625 struct ipv6_pinfo *np = inet6_sk(sk); 625 struct ipv6_pinfo *np = inet6_sk(sk);
626 struct net *net = sock_net(sk); 626 struct net *net = sock_net(sk);
@@ -650,6 +650,7 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length,
650 skb->protocol = htons(ETH_P_IPV6); 650 skb->protocol = htons(ETH_P_IPV6);
651 skb->priority = sk->sk_priority; 651 skb->priority = sk->sk_priority;
652 skb->mark = sk->sk_mark; 652 skb->mark = sk->sk_mark;
653 skb->tstamp = sockc->transmit_time;
653 skb_dst_set(skb, &rt->dst); 654 skb_dst_set(skb, &rt->dst);
654 *dstp = NULL; 655 *dstp = NULL;
655 656
@@ -848,6 +849,7 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
848 fl6.flowi6_oif = sk->sk_bound_dev_if; 849 fl6.flowi6_oif = sk->sk_bound_dev_if;
849 850
850 sockc.tsflags = sk->sk_tsflags; 851 sockc.tsflags = sk->sk_tsflags;
852 sockc.transmit_time = 0;
851 if (msg->msg_controllen) { 853 if (msg->msg_controllen) {
852 opt = &opt_space; 854 opt = &opt_space;
853 memset(opt, 0, sizeof(struct ipv6_txoptions)); 855 memset(opt, 0, sizeof(struct ipv6_txoptions));
@@ -921,7 +923,8 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
921 923
922back_from_confirm: 924back_from_confirm:
923 if (inet->hdrincl) 925 if (inet->hdrincl)
924 err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst, msg->msg_flags); 926 err = rawv6_send_hdrinc(sk, msg, len, &fl6, &dst,
927 msg->msg_flags, &sockc);
925 else { 928 else {
926 ipc6.opt = opt; 929 ipc6.opt = opt;
927 lock_sock(sk); 930 lock_sock(sk);