From 405ed88c78dc9aa492093f64042bd0a3f6552042 Mon Sep 17 00:00:00 2001 From: Anders Berggren Date: Mon, 28 Feb 2011 12:32:11 -0800 Subject: [PATCH] --- yaml --- r: 237493 b: refs/heads/master c: a693e69897e7811e2790295f38a0ce3a92c4b45c h: refs/heads/master i: 237491: f6b70d73049c6683ff0935c7c460e4464ec7e133 v: v3 --- [refs] | 2 +- trunk/net/ipv6/ip6_output.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 6b5fbaf64b4f..6f2132618679 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eaaa3a7c4da2bdc48e536bb750860253150cb931 +refs/heads/master: a693e69897e7811e2790295f38a0ce3a92c4b45c diff --git a/trunk/net/ipv6/ip6_output.c b/trunk/net/ipv6/ip6_output.c index 25a2647f9942..065b3f7614fb 100644 --- a/trunk/net/ipv6/ip6_output.c +++ b/trunk/net/ipv6/ip6_output.c @@ -1118,6 +1118,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int err; int offset = 0; int csummode = CHECKSUM_NONE; + __u8 tx_flags = 0; if (flags&MSG_PROBE) return 0; @@ -1202,6 +1203,13 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, } } + /* For UDP, check if TX timestamp is enabled */ + if (sk->sk_type == SOCK_DGRAM) { + err = sock_tx_timestamp(sk, &tx_flags); + if (err) + goto error; + } + /* * Let's try using as much space as possible. * Use MTU if total length of the message fits into the MTU. @@ -1306,6 +1314,12 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, sk->sk_allocation); if (unlikely(skb == NULL)) err = -ENOBUFS; + else { + /* Only the initial fragment + * is time stamped. + */ + tx_flags = 0; + } } if (skb == NULL) goto error; @@ -1317,6 +1331,9 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, /* reserve for fragmentation */ skb_reserve(skb, hh_len+sizeof(struct frag_hdr)); + if (sk->sk_type == SOCK_DGRAM) + skb_shinfo(skb)->tx_flags = tx_flags; + /* * Find where to start putting bytes */