mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-27 12:05:15 +00:00
do proper mtu detection, ticket #54
This commit is contained in:
parent
7fe021cba9
commit
1971df98ee
15
src/iodine.c
15
src/iodine.c
@ -772,26 +772,27 @@ handshake_autoprobe_fragsize(int dns_fd)
|
|||||||
fprintf(stderr, "%d ok.. ", acked_fragsize);
|
fprintf(stderr, "%d ok.. ", acked_fragsize);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
max_fragsize = acked_fragsize;
|
max_fragsize = acked_fragsize;
|
||||||
range >>= 1;
|
|
||||||
proposed_fragsize += range;
|
|
||||||
continue;
|
|
||||||
} else {
|
|
||||||
goto badlen;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strncmp("BADIP", in, 5) == 0) {
|
if (strncmp("BADIP", in, 5) == 0) {
|
||||||
fprintf(stderr, "got BADIP.. ");
|
fprintf(stderr, "got BADIP.. ");
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
badlen:
|
range >>= 1;
|
||||||
|
if (max_fragsize == proposed_fragsize) {
|
||||||
|
/* Try bigger */
|
||||||
|
proposed_fragsize += range;
|
||||||
|
} else {
|
||||||
|
/* Try smaller */
|
||||||
fprintf(stderr, "%d not ok.. ", proposed_fragsize);
|
fprintf(stderr, "%d not ok.. ", proposed_fragsize);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
range >>= 1;
|
|
||||||
proposed_fragsize -= range;
|
proposed_fragsize -= range;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!running) {
|
if (!running) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
warnx("stopped while autodetecting fragment size (Try probing manually with -m)");
|
warnx("stopped while autodetecting fragment size (Try probing manually with -m)");
|
||||||
|
Loading…
Reference in New Issue
Block a user