Correct an assertion in raw_uattach(): this is a library call that other

protocols invoke after allocating a PCB, so so_pcb should be non-NULL.
It is only used by the two IPSEC implementations, so I didn't hit it in
my testing.

Reported by:	pjd
MFC after:	3 months
This commit is contained in:
Robert Watson 2006-04-09 15:15:28 +00:00
parent 582954da16
commit 9d20951479

View File

@ -155,7 +155,12 @@ raw_uattach(struct socket *so, int proto, struct thread *td)
{
int error;
KASSERT(sotorawcb(so) == NULL, ("raw_uattach: rp != NULL"));
/*
* Implementors of raw sockets will already have allocated the PCB,
* so it must be non-NULL here.
*/
KASSERT(sotorawcb(so) != NULL, ("raw_uattach: so_pcb == NULL"));
if (td && (error = suser(td)) != 0)
return error;
return raw_attach(so, proto);