Page MenuHomeFreeBSD

if_clone: correctly destroy a clone from a different vnet

Authored by glebius on Jan 19 2022, 4:38 AM.
Referenced Files
Unknown Object (File)
Tue, Sep 19, 12:52 PM
Unknown Object (File)
Sat, Sep 2, 10:21 PM
Unknown Object (File)
Fri, Sep 1, 2:32 PM
Unknown Object (File)
Jul 24 2023, 10:27 AM
Unknown Object (File)
Jun 21 2023, 3:42 PM
Unknown Object (File)
May 30 2023, 10:45 AM
Unknown Object (File)
May 19 2023, 5:30 AM
Unknown Object (File)
May 2 2023, 6:33 AM



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

rG FreeBSD src repository
Lint Not Applicable
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. 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.