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
F81602844: D33942.diff
Thu, Apr 18, 7:32 PM
Unknown Object (File)
Tue, Apr 2, 7:12 PM
Unknown Object (File)
Jan 15 2024, 6:23 PM
Unknown Object (File)
Dec 27 2023, 12:50 AM
Unknown Object (File)
Dec 12 2023, 3:17 AM
Unknown Object (File)
Nov 4 2023, 7:34 AM
Unknown Object (File)
Oct 26 2023, 4:38 AM
Unknown Object (File)
Sep 19 2023, 12:52 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.