nfqws: do not perform syndata desync if TCP fast open

This commit is contained in:
bol-van
2024-03-19 21:58:53 +03:00
parent 205d17df01
commit f8e6302844
12 changed files with 22 additions and 0 deletions

View File

@@ -56,6 +56,16 @@ uint8_t tcp_find_scale_factor(const struct tcphdr *tcp)
if (scale && scale[1]==3) return scale[2];
return SCALE_NONE;
}
bool tcp_has_fastopen(const struct tcphdr *tcp)
{
uint8_t *opt;
// new style RFC7413
opt = tcp_find_option((struct tcphdr*)tcp, 34);
if (opt) return true;
// old style RFC6994
opt = tcp_find_option((struct tcphdr*)tcp, 254);
return opt && opt[1]>=4 && opt[2]==0xF9 && opt[3]==0x89;
}
// n prefix (nsport, nwsize) means network byte order
static void fill_tcphdr(