From owner-freebsd-net Thu Sep 12 14: 6:50 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A88C937B401 for ; Thu, 12 Sep 2002 14:06:47 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEB9C43E6A for ; Thu, 12 Sep 2002 14:06:46 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g8CL6Xf68402; Thu, 12 Sep 2002 14:06:33 -0700 (PDT) (envelope-from jdp@vashon.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.12.5/8.12.5/Submit) id g8CL6XvX033841; Thu, 12 Sep 2002 14:06:33 -0700 (PDT) (envelope-from jdp) Date: Thu, 12 Sep 2002 14:06:33 -0700 (PDT) Message-Id: <200209122106.g8CL6XvX033841@vashon.polstra.com> To: net@freebsd.org From: John Polstra Cc: soheil_h_y@hotmail.com Subject: Re: computing the Ack Seq. No. In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article , soheil h wrote: > Hi list > accourding to my code > does anyone think that i must make the th_off ntohsed ????????? > NTOHS(th_off) ????????? > Please verify me > i know that i didn't do that > thanx No, th_off is not a multibyte field, so you don't have to byte swap it. But you do have to byte swap the sequence number (ntohl), the ack (ntohl), and the ip length (ntohs) before you do calculations on them. And then you have to swap the results back (htonl, htons) before you send them out the network. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message