From owner-freebsd-bugs Fri Jan 21 9:10: 9 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id A79361556D for ; Fri, 21 Jan 2000 09:10:04 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id JAA51443; Fri, 21 Jan 2000 09:10:04 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Fri, 21 Jan 2000 09:10:04 -0800 (PST) Message-Id: <200001211710.JAA51443@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Kannan Varadhan Subject: Re: kern/16240: ICMP error generation fails to correctly insert IP ID on returned packet Reply-To: Kannan Varadhan Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/16240; it has been noted by GNATS. From: Kannan Varadhan To: Ruslan Ermilov Cc: kannanv@research.bell-labs.com, Garrett Wollman , freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/16240: ICMP error generation fails to correctly insert IP ID on returned packet Date: Fri, 21 Jan 2000 12:12:53 -0500 Excuse me for being stupid here, but what does ping from SCO hosts have to do with how freebsd behaves? Here's a different synopsis of the bug: freebsd host, call it X, decides to send an ICMP error message. It has to copy back some portion of the original packet that caused the error. During the copy process, the ip_d field of the original packet is not in network byte order. Here's another look at the tcpdump trace: > ### ORIGINATING PACKET. NOTE IP ID is 0194 > 16:31:54.085012 0:50:4:b1:f0:90 0:60:1d:9:0:5a 0800 154: 135.104.73.11.2049 > 135.104.73.82.2094666972: reply ok 112 getattr [|nfs] > 4500 008c 0194 0000 4011 d79f 8768 490b ^^^^ ORIGINAL ip_id > 8768 4952 0801 03e5 0078 152e 7cda 14dc > 0000 0001 0000 0000 0000 0000 0000 0000 > 0000 0000 0000 > > ### ICMP ERROR RETURNED. NOTE IP ID on returned packet is 9401, > ### indicating some byte-ordering problems. > 16:31:54.085486 0:60:1d:9:0:5a 0:50:4:b1:f0:90 0800 70: 135.104.73.82 > 135.104.73.11: icmp: 135.104.73.82 udp port 997 unreachable > 4500 0038 012e 0000 fd01 1b69 8768 4952 > 8768 490b 0303 5e31 0000 0000 4500 008c > 9401 0000 3e11 d99f 8768 490b 8768 4952 ^^^^ Copied ip_id. > 0801 03e5 0078 Looking over the icmp_error code in /sys/netinet/ip_icmp.c, towards the end where it copies the original packet into the icmp packet, we have: 179 icp->icmp_code = code; 180 bcopy((caddr_t)oip, (caddr_t)&icp->icmp_ip, icmplen); 181 nip = &icp->icmp_ip; 182 nip->ip_len = htons((u_short)(nip->ip_len + oiplen)); 183 Clearly, the code goes to the trouble of making sure the ip_len is in network byte order. Why does it not do the same for nip->ip_id? Is that not sufficient? Kannan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message