Hello,
On Wed, May 04, 2022 at 10:50:15PM +0200, Alexander Bluhm wrote:
> Hi,
>
> I missed that pf divert packet is not MP safe yet. The problem is
> that divert_packet() is called from pf with shared net lock and
> sbappendaddr() needs exclusive net lock.
>
> The direct call from pf in IP layer to divert in protocol layer is
> not nice. I not sure how to address that.
one way around it would be to dispatch diverted packets
to task. we do the same for route-to.
>
> As a first step clean up divert_packet():
> - the function never returns an error
> - call variables so and sin like everywhere else
> - use goto bad for error handling
> - fix error counter
> - introduce mutex and refcounting for inp like in the other pcb
> functions
>
> Divert packet is still not MP safe, I will fix it later.
change looks good to me.
OK sashan