NetBSD Problem Report #7781
Received: (qmail 22237 invoked from network); 15 Jun 1999 19:47:33 -0000
Message-Id: <xof7lp52qlr.fsf@blubb.pdc.kth.se>
Date: 15 Jun 1999 21:47:28 +0200
From: joda@pdc.kth.se (Johan Danielsson)
To: gnats-bugs@gnats.netbsd.org
Cc: tech-net@netbsd.org
In-Reply-To: Hubert Feyrer's message of "Thu, 10 Jun 1999 18:37:29 +0200 (MET DST)"
Subject: bug in traceroute mtu-discovery
>Number: 7781
>Category: bin
>Synopsis: bug in traceroute mtu-discovery
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: is
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Jun 15 12:50:01 +0000 1999
>Closed-Date: Wed Jun 16 13:41:08 +0000 1999
>Last-Modified: Wed Jun 16 13:45:16 +0000 1999
>Originator: Johan Danielsson
>Release: <NetBSD-current source date>
>Organization:
>Environment:
<machine, os, target, libraries (multiple lines)>
System: NetBSD blubb.pdc.kth.se 1.4C NetBSD 1.4C (BLUBB+CARDBUS) #61: Thu Jun 10 11:00:19 PDT 1999 joda@blubb.pdc.kth.se:/usr/misc/src/netbsd/netbsd-current/src/sys/arch/i386/compile/BLUBB+CARDBUS i386
>Description:
I've always wondered why I could only get traceroute -P to work with
some machines. It turns out that traceroute doesn't recalculate the
UDP data length when it gets a EMSGSIZE from sendto, as can be seen in
this tcpdump output:
20:16:14.852654 193.10.159.47.46728 > 130.237.232.119.33438: udp 17886 (DF) [ttl 1]
4500 05dc b68c 4000 0111 f1e5 c10a 9f2f
82ed e877 b688 829e 45e6 c987 0402 0000
7ea6 6637 b0f3 0c00 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000
The IP-length is 1500 (05DC), but the UDP-length is 17894 (45E6). Some
machines (BSD-based I guess) apparently discards such packets, while
other (Solaris is one example) thinks everything is cool and froody.
Traceroute also doesn't print what MTU it finally managed to use.
>How-To-Repeat:
traceroute -P to any BSD-based machine.
>Fix:
This simple patch makes this work for me, but it
might not be the most elegant solution.
--- traceroute.c 1999/06/06 03:09:59 1.1.1.3
+++ traceroute.c 1999/06/15 19:42:32
@@ -1101,6 +1101,8 @@
if (errno == EMSGSIZE) {
packlen = *mtuptr++;
+ outudp->uh_ulen =
+ htons((u_short)(packlen - (sizeof(*outip) + optlen)));
#ifdef _NoLongerLooksUgly_
Printf("\nmessage too big, "
"trying new MTU = %d ", packlen);
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed
State-Changed-By: is
State-Changed-When: Wed Jun 16 06:37:03 PDT 1999
State-Changed-Why:
A few cases are missing.
Responsible-Changed-From-To: bin-bug-people->is
Responsible-Changed-By: is
Responsible-Changed-When: Wed Jun 16 06:38:20 PDT 1999
Responsible-Changed-Why:
I'm looking at this.
State-Changed-From-To: analyzed->closed
State-Changed-By: is
State-Changed-When: Wed Jun 16 06:41:08 PDT 1999
State-Changed-Why:
Applied a modified patch provided privately by the
originator.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.