diff options
author | Willem de Bruijn <willemb@google.com> | 2014-07-14 17:55:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-15 16:32:45 -0700 |
commit | 11878b40ed5c5bc20d6a115bae156a5b90b0fb3e (patch) | |
tree | e7fa05e4bc8d22865c7877e05bff85c3ecee1dc8 /net/ipv4/ip_output.c | |
parent | d5c1c93681699a2c354a8999b3c77e419bdadb64 (diff) | |
download | op-kernel-dev-11878b40ed5c5bc20d6a115bae156a5b90b0fb3e.zip op-kernel-dev-11878b40ed5c5bc20d6a115bae156a5b90b0fb3e.tar.gz |
net-timestamp: SOCK_RAW and PING timestamping
Add SO_TIMESTAMPING to sockets of type PF_INET[6]/SOCK_RAW:
Add the necessary sock_tx_timestamp calls to the datapath for RAW
sockets (ping sockets already had these calls).
Fix the IP output path to pass the timestamp flags on the first
fragment also for these sockets. The existing code relies on
transhdrlen != 0 to indicate a first fragment. For these sockets,
that assumption does not hold.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=77221
Tested SOCK_RAW on IPv4 and IPv6, not PING.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Richard Cochran <richardcochran@gmail.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.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 8d3b6b0..b165568 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -962,10 +962,6 @@ alloc_new_skb: sk->sk_allocation); if (unlikely(skb == NULL)) err = -ENOBUFS; - else - /* only the initial fragment is - time stamped */ - cork->tx_flags = 0; } if (skb == NULL) goto error; @@ -976,7 +972,10 @@ alloc_new_skb: skb->ip_summed = csummode; skb->csum = 0; skb_reserve(skb, hh_len); + + /* only the initial fragment is time stamped */ skb_shinfo(skb)->tx_flags = cork->tx_flags; + cork->tx_flags = 0; /* * Find where to start putting bytes. |