Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2000 09:10:04 -0800 (PST)
From:      Kannan Varadhan <kannanv@malgudi.research.bell-labs.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/16240: ICMP error generation fails to correctly insert IP ID on returned packet 
Message-ID:  <200001211710.JAA51443@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/16240; it has been noted by GNATS.

From: Kannan Varadhan <kannanv@malgudi.research.bell-labs.com>
To: Ruslan Ermilov <ru@FreeBSD.org>
Cc: kannanv@research.bell-labs.com,
	Garrett Wollman <wollman@FreeBSD.org>,
	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001211710.JAA51443>