Date: Sun, 27 Aug 2000 03:29:13 +0200 (CEST) From: volf@oasis.IAEhv.nl To: FreeBSD-gnats-submit@freebsd.org Cc: volf@oasis.IAEhv.nl Subject: kern/20877: ICMP error msg on UDP port unreachable is incorrect Message-ID: <20000827012913.B2DF93D@avalon.oasis.IAEhv.nl>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000827012913.B2DF93D>
