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)
Tue, Dec 9, 12:11 AM
Unknown Object (File)
Thu, Nov 27, 3:54 PM
Unknown Object (File)
Tue, Nov 18, 7:14 AM
Unknown Object (File)
Sat, Nov 15, 12:04 PM
Unknown Object (File)
Fri, Nov 14, 7:57 PM
Unknown Object (File)
Oct 29 2025, 8:48 PM
Unknown Object (File)
Oct 29 2025, 8:46 PM
Unknown Object (File)
Oct 29 2025, 1:09 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.