mirror of
https://github.com/bol-van/zapret.git
synced 2026-01-02 06:38:50 +03:00
nfqws: do not perform syndata desync if TCP fast open
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user