From owner-freebsd-hackers Thu Jul 19 15:34:17 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp01.primenet.com (smtp01.primenet.com [64.211.219.50]) by hub.freebsd.org (Postfix) with ESMTP id 7973037B401 for ; Thu, 19 Jul 2001 15:34:06 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.9.3/8.9.3) id PAA15550; Thu, 19 Jul 2001 15:33:57 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp01.primenet.com, id smtpdAAAXcaWrE; Thu Jul 19 15:33:45 2001 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id PAA14287; Thu, 19 Jul 2001 15:41:20 -0700 (MST) From: Terry Lambert Message-Id: <200107192241.PAA14287@usr05.primenet.com> Subject: Re: inpcb question To: sridharv@ufl.edu Date: Thu, 19 Jul 2001 22:41:10 +0000 (GMT) Cc: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 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 ] I have written a kernel module and modified the stack ] code ( at the socket layer) to send control to my ] module. I am trying to access the inpcb structure ] associated with that particular socket. ] struct in_pcb* inp = sotoinpcb(so); ] if (inp) ] .... processing ] ] ] though the pbc structure is allocated i am getting a ] page fault everytime when i try to access it. ] any idea? my code is in the socket layer..i checked up ] the udp routines.. they do pretty much the same thing.. ] any help? It may be that the packets you are processing are not IP packets, and therefore do not have an in_pcb in them. Verify that they are IP packets first, e.g.: if (so->so_proto->pr_domain->dom_family == PF_INET) { struct in_pcb* inp = sotoinpcb(so); if (inp) { ... processing ... } } Pretty obvious in retrospect, eh? -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message