From owner-freebsd-questions Tue Aug 6 3:16:56 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D065D37B400 for ; Tue, 6 Aug 2002 03:16:54 -0700 (PDT) Received: from hotmail.com (f15.law9.hotmail.com [64.4.9.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80AE743E6E for ; Tue, 6 Aug 2002 03:16:54 -0700 (PDT) (envelope-from soheil_h_y@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 6 Aug 2002 03:16:54 -0700 Received: from 62.217.112.191 by lw9fd.law9.hotmail.msn.com with HTTP; Tue, 06 Aug 2002 10:16:53 GMT X-Originating-IP: [62.217.112.191] From: "soheil h" To: freebsd-questions@FreeBSD.ORG Subject: TCP header on IP packet Date: Tue, 06 Aug 2002 14:46:53 +0430 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 06 Aug 2002 10:16:54.0452 (UTC) FILETIME=[635D6740:01C23D32] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG PLEASE HELP ME .... SOS .... Hi list which of these cast is true for accessing the tcphdr outof the 'struct mbuf' in the ip_input function of ip_input.c ? struct mbuf m; struct ip * ip = mtod(m, ip); int iphlen; struct tcphdr* th; hlen = IP_VHL_HL(ip->ip_vhl) << 2; 1. th = (struct tcphdr *)(ip + 1); 2. th = (struct tcphdr *)((caddr_t)ip + hlen); PLEASE HELP ME I THINK THE SECOND ONE IS TRUE BUT IT DOESN' Work . _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message