From owner-freebsd-bugs Sat Aug 26 18:40: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A64B837B42C for ; Sat, 26 Aug 2000 18:40:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id SAA84728; Sat, 26 Aug 2000 18:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from news.IAEhv.nl (news.IAE.nl [194.151.64.4]) by hub.freebsd.org (Postfix) with ESMTP id 785BA37B424 for ; Sat, 26 Aug 2000 18:30:17 -0700 (PDT) Received: (from uucp@localhost) by news.IAEhv.nl (8.9.1/8.9.1) with IAEhv.nl id DAA21466 for FreeBSD-gnats-submit@freebsd.org; Sun, 27 Aug 2000 03:30:16 +0200 (MET DST) Received: from avalon.oasis.IAEhv.nl (avalon.oasis.IAEhv.nl [192.168.1.3]) by drawbridge.oasis.IAEhv.nl (Postfix) with ESMTP id 327493E42 for ; Sun, 27 Aug 2000 03:29:14 +0200 (CEST) Received: by avalon.oasis.IAEhv.nl (Postfix, from userid 226) id B2DF93D; Sun, 27 Aug 2000 03:29:13 +0200 (CEST) Message-Id: <20000827012913.B2DF93D@avalon.oasis.IAEhv.nl> Date: Sun, 27 Aug 2000 03:29:13 +0200 (CEST) From: volf@oasis.IAEhv.nl Reply-To: volf@oasis.IAEhv.nl To: FreeBSD-gnats-submit@freebsd.org Cc: volf@oasis.IAEhv.nl X-Send-Pr-Version: 3.2 Subject: kern/20877: ICMP error msg on UDP port unreachable is incorrect Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 20877 >Category: kern >Synopsis: ICMP error msg on UDP port unreachable is incorrect >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 26 18:40:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Frank Volf >Release: FreeBSD 4.1-STABLE i386 >Organization: /etc/organization >Environment: >Description: When a UDP packet is send to a port that is unreachable (which is a common feature used in e.g. traceroute) an ICMP error message is returned (icmp port unreachable) which includes (part of) the original IP packet. The problem is that this (part of) the original IP packet is not completely correct. The ip_id field is not in network byte order (in ip_input(), ip_id is translated to host byte order), but this is never reverted before the IP packet is send to icmp_error for generation of the ICMP error message. The following patch (relative to 4.1 stable source code) fixes the problem: Index: udp_usrreq.c =================================================================== RCS file: /home2/CVS/src/sys/netinet/udp_usrreq.c,v retrieving revision 1.64.2.3 diff -u -u -r1.64.2.3 udp_usrreq.c --- udp_usrreq.c 2000/08/03 00:09:36 1.64.2.3 +++ udp_usrreq.c 2000/08/27 01:02:35 @@ -358,8 +358,10 @@ if (badport_bandlim(0) < 0) goto bad; #endif - if (!blackhole) + if (!blackhole) { + HTONS(ip->ip_id); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0); + } else goto bad; return; Please commit this patch to the FreeBSD source code repository. Many thanks, Frank >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message