On Fri, Aug 19, 2022 at 12:42 PM Vitaliy Makkoveev <m...@openbsd.org> wrote:

> bluhm@ pointed, that many KASSERT()s are not welcomed, so I didn't
> insert them into newly introduced handlers. Anyway except the tcp(4)
> protocol, `so_pcb' cant be NULL here. But the socket lock assertion
> looks reasonable.
>
> Some unp_*() functions could be merged with newly introduced uipc_*(),
> but I want to do this after (*pru_usrreq)() split finished.
>

Having multiple PROTO_bind() routines that just return EOPNOTSUPP seems
like overkill to me.  I think I would tend to just have the pru_bind()
inline do a NULL test and return EOPNOTSUPP if it is and leave the callback
NULL for all those protocols, but I could also see having a single
prubind_eopnotsupp()  (or whatever you think is a clear name)
implementation in some sys/kern/ file which could then be used by all the
protocols that don't implement it.  Consider how many protocols and
callbacks you're going to be working through and how many stubs that would
be if there's no sharing...

Philip

Reply via email to