Henrique de Moraes Holschuh <[email protected]> writes:
> On Thu, 02 Jun 2011, Peter Palfrader wrote:
>
>> Assume the peer starts with a TTL of 64 that gives you reasonable
>> numbers.
>
> Yes, it does.  I just don't know if it IS a correct measurement, or just
> looks like it.

It is a guess, as documented in tha man page.  

The problem is that the guess is only applied to the intermediate hops
(so you do get the correct "assym" values) but not to the final one.

Moving the guessing logic so that it's always applied regardless of ICMP
error will fix it:


--- iputils-20101006.orig/tracepath6.c  2011-01-24 09:10:05.000000000 +0100
+++ iputils-20101006/tracepath6.c       2011-06-03 12:51:39.000000000 +0200
@@ -250,6 +250,15 @@ restart:
                        printf("(This broken router returned corrupted payload) 
");
        }
 
+       if (rethops>=0) {
+               if (rethops<=64)
+                       rethops = 65-rethops;
+               else if (rethops<=128)
+                       rethops = 129-rethops;
+               else
+                       rethops = 256-rethops;
+       }
+
        switch (e->ee_errno) {
        case ETIMEDOUT:
                printf("\n");
@@ -275,12 +284,6 @@ restart:
                     e->ee_type == 3 &&
                     e->ee_code == 0)) {
                        if (rethops>=0) {
-                               if (rethops<=64)
-                                       rethops = 65-rethops;
-                               else if (rethops<=128)
-                                       rethops = 129-rethops;
-                               else
-                                       rethops = 256-rethops;
                                if (sndhops>=0 && rethops != sndhops)
                                        printf("asymm %2d ", rethops);
                                else if (sndhops<0 && rethops != ttl)



Bjørn


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to