From owner-freebsd-hackers Sat Mar 24 4:23:50 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id CF9AA37B718; Sat, 24 Mar 2001 04:23:40 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f2OCIRo41069; Sat, 24 Mar 2001 14:18:27 +0200 (EET) (envelope-from ru) Date: Sat, 24 Mar 2001 14:18:27 +0200 From: Ruslan Ermilov To: Madhavi Suram Cc: freebsd-hackers@FreeBSD.ORG, Jonathan Lemon Subject: Re: udp checksum problem.. Message-ID: <20010324141827.A38948@sunbay.com> Mail-Followup-To: Madhavi Suram , freebsd-hackers@FreeBSD.ORG, Jonathan Lemon References: <20010324012954.A31961@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from madhavis@sasken.com on Sat, Mar 24, 2001 at 05:10:04PM +0530 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Mar 24, 2001 at 05:10:04PM +0530, Madhavi Suram wrote: > > Hi > > I am modifying FreeBSD 4.1 kernel. I am hacking all UDP packets in > ip_input, changing some headers and finding the udp checksum > using in_pseudo() and setting the packet header csum_flags to > CSUM_UDP (I know this is a dirty way of doing it.. but, had to do it > for efficiency reasons). When I try to see the checksum after the checksum > calculation is complete in ip_output, I am getting the checksum > 65535(0xffff). Is this a special checksum(error or something like > that..)? I have seen INVERT doing something like this in the file > /sys/alpha/alpha/in_cksum.c. > > sum == 0xffff ? 0xffff : ~sum & 0xffff. > > After modifying the packet in ip_input(), I call ip_forward() and the > packet should go and reach the intended destination as usual. But, this > destination address is the one that is changed in ip_input(). But, the > destination host is not getting the packet. I think this is a checksum > problem. > > Could anyone please tell me what checksum 0xffff means, or give me some > pointers to where I can find this information? > INVERT was a failed attempt to comply with RFC 768 requirement to transmit all zero computed checksum as all ones. For some unknown reason, the fix (sys/alpha/alpha/in_cksum.c, revision 1.5) was not yet MFC'ed. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message