This patch to waitpacket.c causes hping2
to increment the TTL when it hits a non
cooperating router. This requires an option
(I use --tr-inc) to set the number of failed
reads to trip the increment. This is required
for using the traceroute option in scripts.
Doug Blewett
blewett@research.att.com
The code goes in right after the call to recv:
size = recv(sockpacket, packet,LINK_PACKETSIZE, 0);
53a61,62
> static int minus_size_count = 0; // cdb
>
61a71,91
> // cdb
> if (opt_traceroute && opt_traceroute_increment > 0)
> {
> if (size == -1)
> {
> // printf(".");
> // fflush(stdout);
> if (opt_traceroute_increment > 0 &&
> minus_size_count >= opt_traceroute_increment)
> {
> printf("hop=%d \"rolling over after %d negative
returns\"\n",
> src_ttl, opt_traceroute_increment);
> fflush(stdout);
> src_ttl++;
> minus_size_count = 0;
> }
> else
> minus_size_count++;
> }
> }
> // cdb