mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-22 06:15:31 +00:00
Fix bug with pastseq and frag-sni-faked
This commit is contained in:
parent
e62d76e1d6
commit
c10393983a
@ -24,8 +24,11 @@
|
||||
#define lgdebugmsg(msg, ...) \
|
||||
(LOG_LEVEL >= VERBOSE_DEBUG ? printf(msg "\n", ##__VA_ARGS__) : 0)
|
||||
|
||||
#define lgtracemsg(msg, ...) \
|
||||
(LOG_LEVEL >= VERBOSE_TRACE ? printf(msg "\n", ##__VA_ARGS__) : 0)
|
||||
|
||||
#define lgtrace(msg, ...) \
|
||||
(LOG_LEVEL >= VERBOSE_TRACE ? printf(msg, ##__VA_ARGS__) : 0)
|
||||
|
||||
#define lgtracemsg(msg, ...) lgtrace(msg "\n", __VA_ARGS__)
|
||||
|
||||
#define lgtrace_start(msg, ...) \
|
||||
(LOG_LEVEL >= VERBOSE_TRACE ? printf("[TRACE] " msg " ( ", ##__VA_ARGS__) : 0)
|
||||
|
9
mangle.c
9
mangle.c
@ -382,6 +382,12 @@ send_fake:
|
||||
}
|
||||
memcpy(fake_pad, frag2, iphfl + tcphfl);
|
||||
memset(fake_pad + iphfl + tcphfl, 0, f2len - iphfl - tcphfl);
|
||||
struct tcphdr *fakethdr = (void *)(fake_pad + iphfl);
|
||||
if (config.faking_strategy == FAKE_STRAT_PAST_SEQ) {
|
||||
lgtrace("frag fake sent with %d -> ", ntohl(fakethdr->seq));
|
||||
fakethdr->seq = htonl(ntohl(fakethdr->seq) - dvs);
|
||||
lgtrace("%d\n", ntohl(fakethdr->seq));
|
||||
}
|
||||
ret = fail4_packet(fake_pad, f2len);
|
||||
if (ret < 0) {
|
||||
lgerror("Failed to fail packet", ret);
|
||||
@ -752,7 +758,10 @@ int fail4_packet(uint8_t *payload, uint32_t plen) {
|
||||
tcph->ack_seq = random();
|
||||
#endif
|
||||
} else if (config.faking_strategy == FAKE_STRAT_PAST_SEQ) {
|
||||
lgtrace("fake sent with %d -> ", ntohl(tcph->seq));
|
||||
tcph->seq = htonl(ntohl(tcph->seq) - dlen);
|
||||
lgtrace("%d\n", ntohl(tcph->seq));
|
||||
|
||||
} else if (config.faking_strategy == FAKE_STRAT_TTL) {
|
||||
iph->ttl = config.faking_ttl;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user