From owner-freebsd-virtualization@FreeBSD.ORG Tue Aug 25 21:13:20 2009 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6548A10656A3 for ; Tue, 25 Aug 2009 21:13:20 +0000 (UTC) (envelope-from nvass9573@gmx.com) Received: from mail.gmx.com (unknown [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id AFEB28FC28 for ; Tue, 25 Aug 2009 21:13:19 +0000 (UTC) Received: (qmail invoked by alias); 25 Aug 2009 21:13:17 -0000 Received: from unknown (EHLO [192.168.23.10]) [79.107.191.15] by mail.gmx.com (mp-eu005) with SMTP; 25 Aug 2009 23:13:17 +0200 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX18+powQcIo+yjY53tKOD7NCPu9NQUVi7nVKqTGkwQ LQQV8HhQ96Z52A Message-ID: <4A9453D9.4020604@gmx.com> Date: Wed, 26 Aug 2009 00:12:57 +0300 From: Nikos Vassiliadis User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Julian Elischer References: <4A93E416.20200@gmx.com> <4A9428CF.6050308@elischer.org> In-Reply-To: <4A9428CF.6050308@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 Cc: FreeBSD virtualization mailing list Subject: Re: interface name collisions X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2009 21:13:20 -0000 Julian Elischer wrote: > We are aware of this. You are of course also welcome to > make suggestions as to what the correct behavior in these > situations should be. > When an interface is moved from a parent to a child vnet a check is done. I tried to copy that behavior. Does it look correct? --- sys/net/if.c.orig 2009-08-24 15:52:05.000000000 +0300 +++ sys/net/if.c 2009-08-25 23:55:26.000000000 +0300 @@ -992,6 +992,13 @@ prison_hold_locked(pr); mtx_unlock(&pr->pr_mtx); + /* Make sure the named iface does not exist in the dst. prison/vnet. */ + ifp = ifunit(ifname); + if (ifp != NULL) { + prison_free(pr); + return (EEXIST); + } + /* Make sure the named iface exists in the source prison/vnet. */ CURVNET_SET(pr->pr_vnet); ifp = ifunit(ifname); /* XXX Lock to avoid races. */ > Thank you for trying out our new little toy! Well, thanks for creating this "little toy":) Nikos