Date: Wed, 18 Jan 2023 10:05:20 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 185619] [VNET] Name conflict not checked when a child vnet goes away and returns its interface(s) back to the parent Message-ID: <bug-185619-227-p7F0aQCvnX@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-185619-227@https.bugs.freebsd.org/bugzilla/> References: <bug-185619-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D185619 Zhenlei Huang <zlei@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kp@freebsd.org, | |melifaro@FreeBSD.org --- Comment #4 from Zhenlei Huang <zlei@FreeBSD.org> --- (In reply to Eugene M. Kim from comment #0) > Option 2 is more predictable and deterministic, at the cost of more compl= ex=20 > implementation. And it doesn't cover the case of pseudo-interfaces creat= ed locally=20 > inside a vnet, because such interfaces have no shadowed name in the paren= t vnet;=20 > falling back to option 1 would be one way to solve this. For pseudo-interfaces created locally inside a vnet (n), their's `home-vnet= ` is same with its vnet (n) and will be destroyed on vnet destroy, so no name conflicts. I think that is a design defeat, as FreeBSD assumes the name of interface is unique in one vnet (namespace) and it allows renaming interfaces. An combination of Option 1 and Option 2: > Option 1: Give the returned interface a random, unique name. > Option 2: When injecting an interface into a child vnet, leave a "shadow"= of its > name in the parent vnet. Don't let other interfaces in the parent vnet t= ake the=20 > shadowed name, and give the shadowed name to the moved interface when it = returns=20 > from the child vnet. I think we may give the interface a global unique unchangeable name (called xname) on create (physical or cloned ones), and refine current name as an a= lias and guarantee the uniqueness only within its vnet (namespace). (In practica= l an interface may have multiple aliases). On vnet destroy an interface returns to its home-vnet, if the alias name conflicts we can remove the alias. That may require KPI/ABI changes. Linux has similar mechanic called `altname`, see https://lwn.net/Articles/794289/=20 CC @kp and @melifaro --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-185619-227-p7F0aQCvnX>