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
F107127745: D33942.diff
Fri, Jan 10, 1:26 PM
Unknown Object (File)
Dec 5 2024, 3:36 AM
Unknown Object (File)
Nov 27 2024, 10:17 AM
Unknown Object (File)
Oct 20 2024, 11:01 AM
Unknown Object (File)
Oct 19 2024, 7:22 PM
Unknown Object (File)
Oct 10 2024, 11:58 AM
Unknown Object (File)
Oct 4 2024, 10:41 PM
Unknown Object (File)
Oct 1 2024, 12:53 PM

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.