mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 20:20:53 +03:00
Compare commits
No commits in common. "7c5aa295c4978d2975e2c017e09032a6adcf7e2f" and "e8a940148aa52906439fdbfa617628ef50d0a7f7" have entirely different histories.
7c5aa295c4
...
e8a940148a
@ -1321,6 +1321,7 @@ static bool logical_net_filter_match_rate_limited(void)
|
||||
static HANDLE windivert_init_filter(const char *filter, UINT64 flags)
|
||||
{
|
||||
LPSTR errormessage = NULL;
|
||||
DWORD errorcode = 0;
|
||||
HANDLE h, hMutex;
|
||||
const char *mutex_name = "Global\\winws_windivert_mutex";
|
||||
|
||||
|
15
nfq/desync.c
15
nfq/desync.c
@ -486,8 +486,8 @@ static uint8_t dpi_desync_tcp_packet_play(bool replay, size_t reasm_offset, uint
|
||||
size_t pkt1_len = sizeof(pkt1), pkt2_len;
|
||||
memset (pkt1, 0, pkt1_len);
|
||||
|
||||
uint8_t ttl_orig,ttl_fake,flags_orig,scale_factor;
|
||||
uint32_t *timestamps;
|
||||
uint8_t ttl_orig,ttl_fake = 0, flags_orig = 0,scale_factor = 0;
|
||||
uint32_t *timestamps = NULL;
|
||||
|
||||
ttl_orig = ip ? ip->ip_ttl : ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_hlim;
|
||||
uint32_t desync_fwmark = fwmark | params.desync_fwmark;
|
||||
@ -1237,10 +1237,13 @@ static uint8_t dpi_desync_udp_packet_play(bool replay, size_t reasm_offset, uint
|
||||
|
||||
uint32_t desync_fwmark = fwmark | params.desync_fwmark;
|
||||
|
||||
ttl_orig = ip ? ip->ip_ttl : (ip6hdr ? ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_hlim : 0);
|
||||
if (ip6hdr) ttl_fake = params.desync_ttl6 ? params.desync_ttl6 : ttl_orig;
|
||||
else ttl_fake = params.desync_ttl ? params.desync_ttl : ttl_orig;
|
||||
|
||||
if (ip6hdr) {
|
||||
ttl_orig = ip ? ip->ip_ttl : ip6hdr->ip6_ctlun.ip6_un1.ip6_un1_hlim;
|
||||
ttl_fake = params.desync_ttl6 ? params.desync_ttl6 : ttl_orig;
|
||||
} else {
|
||||
ttl_orig = ip ? ip->ip_ttl : 0;
|
||||
ttl_fake = params.desync_ttl ? params.desync_ttl : ttl_orig;
|
||||
}
|
||||
extract_endpoints(ip, ip6hdr, NULL, udphdr, &src, &dst);
|
||||
|
||||
if (len_payload)
|
||||
|
@ -277,11 +277,11 @@ static bool TLSExtractHostFromExt(const uint8_t *ext, size_t elen, char *host, s
|
||||
// u16 data+0 - name list length
|
||||
// u8 data+2 - server name type. 0=host_name
|
||||
// u16 data+3 - server name length
|
||||
if (elen < 5 || ext[2] != 0) return false;
|
||||
if (elen < 5 || (ext && ext[2] != 0)) return false;
|
||||
size_t slen = pntoh16(ext + 3);
|
||||
ext += 5; elen -= 5;
|
||||
if (slen < elen) return false;
|
||||
if (host && len_host)
|
||||
if (ext && len_host)
|
||||
{
|
||||
if (slen >= len_host) slen = len_host - 1;
|
||||
for (size_t i = 0; i < slen; i++) host[i] = tolower(ext[i]);
|
||||
|
@ -267,11 +267,11 @@ static bool TLSExtractHostFromExt(const uint8_t *ext, size_t elen, char *host, s
|
||||
// u16 data+0 - name list length
|
||||
// u8 data+2 - server name type. 0=host_name
|
||||
// u16 data+3 - server name length
|
||||
if (elen < 5 || ext[2] != 0) return false;
|
||||
if (elen < 5 || (ext && ext[2] != 0)) return false;
|
||||
size_t slen = pntoh16(ext + 3);
|
||||
ext += 5; elen -= 5;
|
||||
if (slen < elen) return false;
|
||||
if (host && len_host)
|
||||
if (ext && len_host)
|
||||
{
|
||||
if (slen >= len_host) slen = len_host - 1;
|
||||
for (size_t i = 0; i < slen; i++) host[i] = tolower(ext[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user