From ee99301b07fc59b895daeb9dacac51cc6056dc8b Mon Sep 17 00:00:00 2001 From: rwatson Date: Sun, 9 Apr 2006 15:15:28 +0000 Subject: 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 --- sys/net/raw_usrreq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/net/raw_usrreq.c') diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c index 33991a3..5a7449a 100644 --- a/sys/net/raw_usrreq.c +++ b/sys/net/raw_usrreq.c @@ -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); -- cgit v1.1