Page MenuHomeFreeBSD

if_clone: correctly destroy a clone from a different vnet
ClosedPublic

Authored by glebius on Jan 19 2022, 4:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 23, 9:00 PM
Unknown Object (File)
Fri, Jan 23, 1:24 PM
Unknown Object (File)
Fri, Jan 23, 12:09 PM
Unknown Object (File)
Fri, Jan 23, 10:31 AM
Unknown Object (File)
Jan 1 2026, 12:35 AM
Unknown Object (File)
Dec 18 2025, 9:50 AM
Unknown Object (File)
Dec 18 2025, 4:59 AM
Unknown Object (File)
Dec 9 2025, 12:11 AM

Details

Summary

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43981
Build 40869: arc lint + arc unit

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Jan 25 2022, 5:10 AM
This revision was automatically updated to reflect the committed changes.

Found this while try MFCing some commits for sys/net/if_clone.c.

@bz mentioned similar problem for loaned physical interfaces. https://reviews.freebsd.org/D37957 should fix those problem perfectly.

BTW, I think it is wrong to let loaner vnet destroy the loaned interfaces, anyway it is good for a temporary workaround.

As release/14 is coming, I think I should rush for that.