summaryrefslogtreecommitdiffstats
path: root/sys/net/raw_cb.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-07-09 18:41:31 +0000
committerrwatson <rwatson@FreeBSD.org>2008-07-09 18:41:31 +0000
commitee5ac1d2dd7a0f0f679b251d68c6357dc8031e10 (patch)
treed04fb39bab344cfdc9d6455dd2212a3a4e0fdff4 /sys/net/raw_cb.c
parent10a3215125103808fbeea2ae34454b38f6a9d84f (diff)
downloadFreeBSD-src-ee5ac1d2dd7a0f0f679b251d68c6357dc8031e10.zip
FreeBSD-src-ee5ac1d2dd7a0f0f679b251d68c6357dc8031e10.tar.gz
Rather than checking for a NULL so_pcb in raw_attach(), assert that
it's non-NULL, as all callers can and should already do the required checking. Update comments a bit more to talk about rawcb allocation for consumers. Reviewed by: bz MFC after: 3 weeks
Diffstat (limited to 'sys/net/raw_cb.c')
-rw-r--r--sys/net/raw_cb.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c
index 3de6903..38d090c 100644
--- a/sys/net/raw_cb.c
+++ b/sys/net/raw_cb.c
@@ -78,12 +78,13 @@ raw_attach(struct socket *so, int proto)
int error;
/*
- * It is assumed that raw_attach is called
- * after space has been allocated for the
- * rawcb.
+ * It is assumed that raw_attach is called after space has been
+ * allocated for the rawcb; consumer protocols may simply allocate
+ * type struct rawcb, or a wrapper data structure that begins with a
+ * struct rawcb.
*/
- if (rp == 0)
- return (ENOBUFS);
+ KASSERT(rp != NULL, ("raw_attach: rp == NULL"));
+
error = soreserve(so, raw_sendspace, raw_recvspace);
if (error)
return (error);
OpenPOWER on IntegriCloud