From owner-freebsd-net@FreeBSD.ORG Tue Apr 20 23:38:19 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06F8316A4CE for ; Tue, 20 Apr 2004 23:38:19 -0700 (PDT) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id C054D43D2F for ; Tue, 20 Apr 2004 23:38:18 -0700 (PDT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.8) with ESMTP id i3L6cIgd047011; Tue, 20 Apr 2004 23:38:18 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id i3L6cIjG047010; Tue, 20 Apr 2004 23:38:18 -0700 (PDT) (envelope-from rizzo) Date: Tue, 20 Apr 2004 23:38:18 -0700 From: Luigi Rizzo To: Petri Helenius Message-ID: <20040420233818.B43347@xorpc.icir.org> References: <20040419110912.A71274@xorpc.icir.org> <408613F7.1090806@he.iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <408613F7.1090806@he.iki.fi>; from pete@he.iki.fi on Wed, Apr 21, 2004 at 09:25:59AM +0300 cc: net@freebsd.org Subject: Re: what is the story on if_index allocation ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 06:38:19 -0000 On Wed, Apr 21, 2004 at 09:25:59AM +0300, Petri Helenius wrote: > Luigi Rizzo wrote: > > >Can someone explain what is the goal ? Reuse a number if an > >interface has the same name of a previously existing one and > >the index is free ? And does it make sense, anyways, or > >we could just simplify that code and just reuse the first > >available entry in ifindex_table[] ? > > > > > The optimal course of action (from management software point of view) is > to retain as static ifName to ifIndex mapping. If the index changes for I do not think the current code supports this, as any free index at the top of the array is reused. So if you had 'vlan12' there and it went away, the next interface that comes in will grab that index and vlan12 will get a new one. On top of this you can rename interfaces without changing the index, you can change MAC and IP addresses, in the already mentioned case of a tunnel server there is basically no relation between successive creations on the same interface. My feeling is that there is not even a sensible way to specify how one would like to retain the mapping of indexes, let alone the fact that the specification changes depending on whom you ask. When this happens, it is a good hint to move the issue outside the kernel. cheers luigi