HomeFreeBSD

if_clone: correctly destroy a clone from a different vnet

Description

if_clone: correctly destroy a clone from a different vnet

Try to live with cruel reality fact - if_vmove doesn't move an
interface from previous vnet cloning infrastructure to the new
one. Let's admit this as design feature and make it work better.

  • Delete two blocks of code that would fallback to vnet0, if a cloner isn't found. They didn't do any good job and also whole idea of treating vnet0 as special one is wrong.
  • When deleting a cloned interface, lookup its cloner using it's home vnet.

With this change simple sequence works correctly:

ifconfig foo0 create
jail -c name=jj persist vnet vnet.interface=foo0
jexec jj ifconfig foo0 destroy

Differential revision: https://reviews.freebsd.org/D33942

(cherry picked from commit 6d1808f051a5f8e3b546442b9bcab3d03f04ef8a)

Details

Provenance
glebiusAuthored on Jan 25 2022, 5:07 AM
zleiCommitted on Oct 10 2024, 10:00 AM
Differential Revision
D33942: if_clone: correctly destroy a clone from a different vnet
Parents
rG5a894ac4311e: if_vmove: improve restoration in cloner's ifgroup membership
Branches
Unknown
Tags
Unknown