Subject: bin/19069: traceroute(8) and traceroute6(8) can send packet to udp port 0, which is illegal
To: None <gnats-bugs@gnats.netbsd.org>
From: None <itojun@itojun.org>
List: netbsd-bugs
Date: 11/16/2002 13:14:33
>Number:         19069
>Category:       bin
>Synopsis:       traceroute(8) and traceroute6(8) can send packet to udp port 0, which is illegal
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 15 20:15:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jun-ichiro itojun Hagino
>Release:        NetBSD 1.6K
>Organization:
	itojun.org
>Environment:
System: NetBSD starfruit.itojun.org 1.6K NetBSD 1.6K (STARFRUIT) #23: Thu Nov 14 13:16:47 JST 2002 itojun@starfruit.itojun.org:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/STARFRUIT i386
Architecture: i386
Machine: i386
>Description:
	if you specify large starting port to traceroute(8) or traceroute6(8)
	with -p, it can emit packet to udp port 0, which is illegal.
	(source port 0 is legal, destinationi port 0 is illegal based on
	udp spec)

>How-To-Repeat:
% traceroute -p 65530 coconut
# tcpdump -n -i wi0 udp
tcpdump: listening on wi0
13:09:40.933387 204.42.71.254.39022 > 219.101.47.130.65531: udp 12 [ttl 1]
13:09:40.935752 204.42.71.254.39022 > 219.101.47.130.65532: udp 12 [ttl 1]
13:09:40.943266 204.42.71.254.39022 > 219.101.47.130.65533: udp 12 [ttl 1]
13:09:40.945421 204.42.71.254.39022 > 219.101.47.130.65534: udp 12
13:09:40.950807 204.42.71.254.39022 > 219.101.47.130.65535: udp 12
13:09:40.953856 204.42.71.254.39022 > 219.101.47.130.0: udp 12		<---
13:09:40.957898 204.42.71.254.39022 > 219.101.47.130.1: udp 12
13:09:40.963449 204.42.71.254.39022 > 219.101.47.130.2: udp 12
13:09:40.968796 204.42.71.254.39022 > 219.101.47.130.3: udp 12
13:09:40.972650 204.42.71.254.39022 > 219.101.47.130.4: udp 12
13:09:40.993057 204.42.71.254.39022 > 219.101.47.130.5: udp 12
13:09:41.013815 204.42.71.254.39022 > 219.101.47.130.6: udp 12
13:09:41.034771 204.42.71.254.39022 > 219.101.47.130.7: udp 12
13:09:41.056732 204.42.71.254.39022 > 219.101.47.130.8: udp 12
13:09:41.078967 204.42.71.254.39022 > 219.101.47.130.9: udp 12
13:09:41.099369 204.42.71.254.39022 > 219.101.47.130.10: udp 12
13:09:41.180675 204.42.71.254.39022 > 219.101.47.130.11: udp 12
13:09:41.263266 204.42.71.254.39022 > 219.101.47.130.12: udp 12
13:09:41.344700 204.42.71.254.39022 > 219.101.47.130.13: udp 12

>Fix:
	look for "port + seq" expression, and adjust them appropriately.
>Release-Note:
>Audit-Trail:
>Unformatted: