+ if (nread < 36 + header_size) { continue; }
+ // We're a server and just got a client...walk options until we find timestamps
+ const unsigned char* opt_buf = tcp_buf + 20;
+ bool found_magic = false;
+ while (!found_magic && opt_buf < buf + nread) {
+ switch (*opt_buf) {
+ case 1: opt_buf += 1; break;
+ case 2: opt_buf += 4; break;
+ case 3: opt_buf += 3; break;
+ // SACK should never appear
+ case 8:
+ if (opt_buf + 10 <= buf + nread) {
+ if (!memcmp(opt_buf + 2, ×tamps_magic, 8)) {
+ found_magic = true;
+ break;
+ }
+ }
+ // Fall through
+ default: opt_buf = buf + nread;
+ }
+ }
+ if (!found_magic) continue;