HomeFreeBSD

inpcb: reoder inpcb destruction

Description

inpcb: reoder inpcb destruction

First, merge in_pcbdetach() with in_pcbfree(). The comment for
in_pcbdetach() was no longer correct. Then, make sure we remove
the inpcb from the hash before we commit any destructive actions
on it. There are couple functions that rely on the hash lock
skipping SMR + inpcb lock to lookup an inpcb. Although there are
no known functions that similarly rely on the global inpcb list
lock, also do list removal before destructive actions.

PR: 273890
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43122

(cherry picked from commit a13039e2709277b1c3b159e694cc909a5e044151)

Details

Provenance
glebiusAuthored on Dec 27 2023, 4:34 PM
Reviewer
markj
Differential Revision
D43122: inpcb: reoder inpcb destruction
Parents
rG7cfc847aba13: pfil: don't leak pfil_head_t on interface detach
Branches
Unknown
Tags
Unknown