Bill Sommerfeld writes: > - Adding two new Consolidation Private interfaces > cred_t *msg_getcred(mblk_t *, pid_t *); > cred_t *msg_extractcred(mblk_t *, pid_t *) > The pid_t pointer can be NULL if the caller doesn't care. > > msg_getcred() finds the first non-NULL db_credp in > the message b_cont chain and returns it, plus any db_cpid in that mblk. > msg_extractcred() is a variant of msg_getcred() which clears the db_credp > it > finds hence returns with a held cred_t (or NULL). That avoids a > crhold/rele > pair in performance critical paths.
The behavior of msg_extractcred seems a little unclear. Is it possible for an mblk_t b_cont chain to have two or more mblk_t entries with non-NULL db_credp? If so, then extracting can have the strange side-effect of uncovering old creds unless the function continues through the rest of the b_cont chain, clearing out and discarding any creds it finds. > This fasttrack will add an additional function pointer, su_ucred, to the > upcall structure in order to pass cred_t and pid_t from SCTP to sockfs, > and as result of that addition we are increasing the SCTP_ITF_VER > version number. Version number? Are there users of this interface outside of ON? -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
