@@ -484,16 +484,15 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
* This counter is used both as a hash input and partially encoded into
* the cookie value. A cookie is only validated further if the delta
* between the current counter value and the encoded one is less than this,
- * i.e. a sent cookie is valid only at most for 128 seconds (or less if
+ * i.e. a sent cookie is valid only at most for 2*68 seconds (or less if
* the counter advances immediately after a cookie is generated).
*/
#define MAX_SYNCOOKIE_AGE 2
static inline u32 tcp_cookie_time(void)
{
- struct timespec now;
- getnstimeofday(&now);
- return now.tv_sec >> 6; /* 64 seconds granularity */
+ /* 2^36 nsec = ~68.7 sec */
+ return local_clock() >> 36;
}
u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th,