summaryrefslogtreecommitdiff
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-04-25 01:22:53 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-25 01:22:53 -0400
commit660f7d22298ceb82facd2088c197f2de5cbfb7d6 (patch)
tree2413117b5a07e3632a392e4f03a76ebb37e9c157 /net/core/skbuff.c
parent92dea7c06656f709a3957aacef20574ce3dbe6fc (diff)
parent2940b26bec9fe5bf183c994678e62b55d35717e6 (diff)
downloadlinux-660f7d22298ceb82facd2088c197f2de5cbfb7d6.tar.gz
linux-660f7d22298ceb82facd2088c197f2de5cbfb7d6.tar.xz
Merge branch 'af_packet-timestamp'
Daniel Borkmann says: ==================== This is a joint effort with Willem to bring optional i) tx hw/sw timestamping into PF_PACKET, that was reported by Paul Chavent, and ii) to expose the type of timestamp to the user, which is in the current situation not possible to distinguish with the RX_RING and TX_RING API (but distinguishable through the normal timestamping API), reported by Richard Cochran. This set is based on top of ``packet: account statistics only in tpacket_stats_u''. Related discussion can be found in: http://patchwork.ozlabs.org/patch/238125/ ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 898cf5c566f9..af9185d0be6a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3327,12 +3327,8 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
if (!sk)
return;
- skb = skb_clone(orig_skb, GFP_ATOMIC);
- if (!skb)
- return;
-
if (hwtstamps) {
- *skb_hwtstamps(skb) =
+ *skb_hwtstamps(orig_skb) =
*hwtstamps;
} else {
/*
@@ -3340,9 +3336,13 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
* so keep the shared tx_flags and only
* store software time stamp
*/
- skb->tstamp = ktime_get_real();
+ orig_skb->tstamp = ktime_get_real();
}
+ skb = skb_clone(orig_skb, GFP_ATOMIC);
+ if (!skb)
+ return;
+
serr = SKB_EXT_ERR(skb);
memset(serr, 0, sizeof(*serr));
serr->ee.ee_errno = ENOMSG;