Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2001 22:41:10 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        sridharv@ufl.edu
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: inpcb question
Message-ID:  <200107192241.PAA14287@usr05.primenet.com>

next in thread | raw e-mail | index | archive | help
] 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107192241.PAA14287>