diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 065df67b6422..d59428877078 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1282,16 +1282,19 @@ static inline int sock_intr_errno(long timeo) | |||
1282 | static __inline__ void | 1282 | static __inline__ void |
1283 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 1283 | sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) |
1284 | { | 1284 | { |
1285 | struct timeval *stamp = &skb->stamp; | 1285 | struct timeval stamp; |
1286 | |||
1287 | skb_get_timestamp(skb, &stamp); | ||
1286 | if (sock_flag(sk, SOCK_RCVTSTAMP)) { | 1288 | if (sock_flag(sk, SOCK_RCVTSTAMP)) { |
1287 | /* Race occurred between timestamp enabling and packet | 1289 | /* Race occurred between timestamp enabling and packet |
1288 | receiving. Fill in the current time for now. */ | 1290 | receiving. Fill in the current time for now. */ |
1289 | if (stamp->tv_sec == 0) | 1291 | if (stamp.tv_sec == 0) |
1290 | do_gettimeofday(stamp); | 1292 | do_gettimeofday(&stamp); |
1293 | skb_set_timestamp(skb, &stamp); | ||
1291 | put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(struct timeval), | 1294 | put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(struct timeval), |
1292 | stamp); | 1295 | &stamp); |
1293 | } else | 1296 | } else |
1294 | sk->sk_stamp = *stamp; | 1297 | sk->sk_stamp = stamp; |
1295 | } | 1298 | } |
1296 | 1299 | ||
1297 | /** | 1300 | /** |