|
@@ -2239,6 +2239,7 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
|
|
|
void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
|
|
|
struct sk_buff *skb);
|
|
|
|
|
|
+#define SK_DEFAULT_STAMP (-1L * NSEC_PER_SEC)
|
|
|
static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
|
|
|
struct sk_buff *skb)
|
|
|
{
|
|
@@ -2249,8 +2250,10 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
|
|
|
|
|
|
if (sk->sk_flags & FLAGS_TS_OR_DROPS || sk->sk_tsflags & TSFLAGS_ANY)
|
|
|
__sock_recv_ts_and_drops(msg, sk, skb);
|
|
|
- else
|
|
|
+ else if (unlikely(sk->sk_flags & SOCK_TIMESTAMP))
|
|
|
sk->sk_stamp = skb->tstamp;
|
|
|
+ else if (unlikely(sk->sk_stamp == SK_DEFAULT_STAMP))
|
|
|
+ sk->sk_stamp = 0;
|
|
|
}
|
|
|
|
|
|
void __sock_tx_timestamp(__u16 tsflags, __u8 *tx_flags);
|