From owner-freebsd-hackers Sat Mar 24 3:40:21 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from samar.sasi.com (samar.sasken.com [164.164.56.2]) by hub.freebsd.org (Postfix) with ESMTP id 9B10137B71A for ; Sat, 24 Mar 2001 03:40:11 -0800 (PST) (envelope-from madhavis@sasken.com) Received: from samar (samar.sasi.com [164.164.56.2]) by samar.sasi.com (8.9.3/8.9.3) with SMTP id RAA09850 for ; Sat, 24 Mar 2001 17:10:05 +0530 (IST) Received: from pcs111.sasi.com ([10.0.36.111]) by samar.sasi.com; Sat, 24 Mar 2001 17:10:05 +0000 (IST) Received: from localhost (madhavis@localhost) by pcs111.sasi.com (8.9.3/8.9.3) with ESMTP id RAA15467 for ; Sat, 24 Mar 2001 17:10:05 +0530 X-Authentication-Warning: pcs111.sasi.com: madhavis owned process doing -bs Date: Sat, 24 Mar 2001 17:10:04 +0530 (IST) From: Madhavi Suram X-Sender: madhavis@pcs111.sasi.com To: freebsd-hackers@FreeBSD.ORG Subject: udp checksum problem.. In-Reply-To: <20010324012954.A31961@xor.obsecurity.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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? Also, could anyone tell me if there are any csum_flags other than CSUM_UDP and CSUM_DELAY_DATA in the mbuf packet header that can be set before a udp packet reaches ip_output()? thanks in advance. regards Madhavi. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message