Re: [PATCH] [Syncookies:] Add support for TCP-options via timestamps.
From: Florian Westphal <fw@strlen.de>
Date: 2008-03-31 21:00:34
Glenn Griffin [off-list ref] wrote:
quoted
+ u32 ts, ts_now = tcp_time_stamp; + + if (unlikely(options > ts_now)) { /* recent overflow */ + options |= ~(TSMASK); + return options; + } + ts = ts_now & ~TSMASK; + ts |= options; + if (ts > ts_now) { /* try to fix up ... */ + ts >>= TSBITS; + ts--; + ts <<= TSBITS; + ts |= options; + } + return ts; +}I may be missing something obvious, but I'm failing to see where the initial if(options > ts_now) does anything different from the more generic logic below it.
You're right, I'll drop the first one.
Also the 'return ts' line is indented using spaces rather than tabs.
Yes. I'll fix this, thanks. I think it might be better to avoid duplicating 'cookie_check_timestamp()' in ipv6/syncookies.c; so i'll change that as well. I'll wait a few hours before submitting an updated version in case others wish to provide feedback. Glenn, should I add your SoB-Line when I send an updated version? After all, this patch re-uses some of your earlier work. Thanks again for reviewing this.