NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/39157: traceroute not 64 bit aware (struct timeval issue)



>Number:         39157
>Category:       bin
>Synopsis:       traceroute not 64 bit aware (struct timeval issue)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 16 20:45:00 +0000 2008
>Originator:     Markus Mayer
>Release:        NetBSD 4.0
>Organization:
Redback Networks Inc.
>Environment:
NetBSD mmayer-u5.van.redback.com 4.0 NetBSD 4.0 (GENERIC) #0: Sun Dec 16 
02:17:35 PST 2007  
builds@wb26:/home/builds/ab/netbsd-4-0-RELEASE/sparc64/200712160005Z-obj/home/builds/ab/netbsd-4-0-RELEASE/src/sys/arch/sparc64/compile/GENERIC
 sparc64

>Description:
Unlike ping, which declares struct tv32 and converts timestamps between struct 
tv32 and struct timeval, traceroute doesn't do this yet and directly uses 
struct timeval everywhere (including struct outdata).

On 64 bit systems, that leads to excessive packet length (52 bytes instead of 
40 bytes) of traceroute packets.

Traceroute still seems to work with the 52 byte packets, but side effects 
cannot be ruled out.
>How-To-Repeat:
Run traceroute and look at the packet size (52 bytes instead of 40 bytes)

On NetBSD/64:

$ traceroute www.google.ca
traceroute: Warning: www.google.ca has multiple addresses; using 209.85.173.147
traceroute to www.l.google.com (209.85.173.147), 64 hops max, 52 byte packets

On Linux:

$ traceroute www.google.ca
traceroute: Warning: www.google.ca has multiple addresses; using 209.85.173.103
traceroute to mh-in-f103.google.com (209.85.173.103), 30 hops max, 40 byte 
packets

On Solaris:

$ traceroute www.google.ca
traceroute: Warning: www.l.google.com has multiple addresses; using 
209.85.135.103
traceroute to www.l.google.com (209.85.135.103), 30 hops max, 40 byte packets

>Fix:
Introduce struct tv32 like it was done for ping. The excessive packet length 
comes from

struct outdata {
        u_char seq;             /* sequence number of this packet */
        u_char ttl;             /* ttl packet left with */
        struct timeval tv;      /* time packet left */
};

It should be

struct outdata {
        u_char seq;             /* sequence number of this packet */
        u_char ttl;             /* ttl packet left with */
        struct tv32 tv;         /* time packet left */
};

instead, struct tv32 being declared as (per ping)

struct tv32 {
        int32_t tv32_sec;
        int32_t tv32_usec;
};



Home | Main Index | Thread Index | Old Index