HomeFreeBSD

if_ovpn: ensure we're in vnet context when calling sorele()

Description

if_ovpn: ensure we're in vnet context when calling sorele()

We reference count to ensure we don't release the socket while we still
have data in flight. That means that we can end up releasing the socket
from ovpn_encrypt_tx_cb().

We must have a vnet context set when calling sorele() (which asserts
this from within sofree()), so move the CURVNET_SET()/CURVNET_RESTORE()
to ensure this is the case.

While here also add a couple of assertions to make this more obvious,
and to ease future debugging.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D37326

Details

Provenance
kpAuthored on Nov 10 2022, 12:54 PM
Differential Revision
D37326: if_ovpn: ensure we're in vnet context when calling sorele()
Parents
rG882fc6da1a5f: RELNOTE: Document the removal of mta_start_script and othermta
Branches
Unknown
Tags
Unknown