From owner-freebsd-hackers Thu Sep 20 20:45:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ipperformance.com (ipperf.com [206.225.36.162]) by hub.freebsd.org (Postfix) with ESMTP id 16ED937B406 for ; Thu, 20 Sep 2001 20:45:44 -0700 (PDT) Received: from ipperformance.com (cs6668163-239.austin.rr.com [66.68.163.239]) by ipperformance.com (8.9.3/8.9.3) with SMTP id WAA12240; Thu, 20 Sep 2001 22:45:36 -0500 (CDT) (envelope-from matt@ipperformance.com) Message-ID: <3BAAB6AA.9D7EDD99@ipperformance.com> Date: Thu, 20 Sep 2001 22:40:26 -0500 From: Matt Finlay X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Les Biffle , davep@afterswish.com, Alfred Perlstein , hackers@FreeBSD.ORG Subject: Re: sendto not sending what I asked... References: <200109210250.f8L2oO615274@ns3.safety.net> <3BAAB547.C065FF97@ipperformance.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG come to think of it... perhaps you are not calculating the tcp checksum correctly because of the tcp/ip pseudo header. i no longer have the code that was posted, but thinking back i believe this might be the case. Matt Finlay wrote: > Les Biffle wrote: > > > > pkt.ipbit.ip_sum=in_cksum((unsigned short*)(void*)&pkt,20); > > > pkt.tcpbit.th_sum=tcpsum(&pkt.ipbit); > > > > You need to do the TCP checksum first. It changes the payload (the TCP > > checksum). The IP checksum includes all data, so must be done after the > > payload changes are done. > > i think this is incorrect. the IP checksum only includes the IP header and > any IP options. therefore order should not matter. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message