HomeFreeBSD

ifnet: Fix decreasing the vnet interface count

Description

ifnet: Fix decreasing the vnet interface count

It should be decreased only when the interface has been successfully
removed from the "active" list.

This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".

Reviewed by: kp, pouria
Fixes: a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D55873

Details

Provenance
zleiAuthored on Mar 16 2026, 4:20 PM
Reviewer
rGa779388f8bb3: if: Protect V_ifnet in vnet_if_return()
Differential Revision
D55873: ifnet: Fix decreasing the vnet interface count
Parents
rG33e0568d30a6: ure(4): Fix spurious link flaps from MII
Branches
Unknown
Tags
Unknown