CVSROOT:        /cvs
Module name:    src
Changes by:     bl...@cvs.openbsd.org   2022/08/08 06:06:31

Modified files:
        sys/net        : pf.c 
        sys/netinet    : in_pcb.c tcp_input.c tcp_subr.c tcp_usrreq.c 
                         udp_usrreq.c 
        sys/netinet6   : in6_pcb.c raw_ip6.c 

Log message:
To make protocol input functions MP safe, internet PCB need protection.
Use their reference counter in more places.
The in_pcb lookup functions hold the PCBs in hash tables protected
by table->inpt_mtx mutex.  Whenever a result is returned, increment
the ref count before releasing the mutex.  Then the inp can be used
as long as neccessary.  Unref it at the end of all functions that
call in_pcb lookup.
As a shortcut, pf may also hold a reference to the PCB.  When
pf_inp_lookup() returns it, it also incements the ref count and the
caller can handle it like the inp from table lookup.
OK sashan@

Reply via email to