Browse Source

Add safekeeping TTL value for Auto TTL

windivert2
ValdikSS 3 years ago
parent
commit
e1e09f9103
  1. 10
      src/ttltrack.c

10
src/ttltrack.c

@ -222,10 +222,16 @@ int tcp_get_auto_ttl(const uint8_t ttl, const uint8_t decrease_for) {
uint8_t ttl_of_fake_packet = 0;
if (ttl > 64 && ttl < 128) {
ttl_of_fake_packet = 128 - ttl - decrease_for;
/* Safekeeping */
if (128 - ttl > decrease_for + 1) {
ttl_of_fake_packet = 128 - ttl - decrease_for;
}
}
else if (ttl > 34 && ttl < 64) {
ttl_of_fake_packet = 64 - ttl - decrease_for;
/* Safekeeping */
if (64 - ttl > decrease_for + 1) {
ttl_of_fake_packet = 64 - ttl - decrease_for;
}
}
else {
ttl_of_fake_packet = 0;

Loading…
Cancel
Save