/* when syncookies are in effect and tcp timestamps are enabled we encode tcp options in the lowest 9 bits of the timestamp value that will be sent in the syn-ack. Since subsequent timestamps use the normal tcp_time_stamp value, we must make sure that the resulting initial timestamp is <= tcp_time_stamp.  */
__u32 cookie_init_timestamp(struct request_sock *req)
/* when syncookies are in effect and tcp timestamps are enabled we encode tcp options in the lowest 9 bits of the timestamp value that will be sent in the syn-ack. Since subsequent timestamps use the normal tcp_time_stamp value, we must make sure that the resulting initial timestamp is <= tcp_time_stamp.  */
__u32 cookie_init_timestamp(struct request_sock *req)
{
	struct inet_request_sock *ireq;
	u32 ts, ts_now = tcp_time_stamp;
	u32 options = 0;
	ireq = inet_rsk(req);
	if (ireq->wscale_ok) {
		options = ireq->snd_wscale;
		options |= ireq->rcv_wscale << 4;
	}
	options |= ireq->sack_ok << 8;
	ts = ts_now & ~TSMASK;
	ts |= options;
	if (ts > ts_now) {
		ts >>= TSBITS;
		ts--;
		ts <<= TSBITS;
		ts |= options;
	}
	return ts;
}