diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-04-09 15:15:28 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-04-09 15:15:28 +0000 |
commit | ee99301b07fc59b895daeb9dacac51cc6056dc8b (patch) | |
tree | 78d5aa2334e03d723239121cbfb562ad7629c86b /sys/net/raw_usrreq.c | |
parent | 82e28c7b987817683569181eb05d98082f7e825b (diff) | |
download | FreeBSD-src-ee99301b07fc59b895daeb9dacac51cc6056dc8b.zip FreeBSD-src-ee99301b07fc59b895daeb9dacac51cc6056dc8b.tar.gz |
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
Diffstat (limited to 'sys/net/raw_usrreq.c')
-rw-r--r-- | sys/net/raw_usrreq.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |