From owner-freebsd-net@FreeBSD.ORG Thu Apr 22 07:13:42 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 CFAFA16A4CE for ; Thu, 22 Apr 2004 07:13:42 -0700 (PDT) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id E56D843D1D for ; Thu, 22 Apr 2004 07:13:41 -0700 (PDT) (envelope-from andre@freebsd.org) Received: (qmail 72681 invoked from network); 22 Apr 2004 14:13:41 -0000 Received: from unknown (HELO freebsd.org) ([62.48.0.53]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 22 Apr 2004 14:13:41 -0000 Message-ID: <4087D314.F5ED2344@freebsd.org> Date: Thu, 22 Apr 2004 16:13:40 +0200 From: Andre Oppermann X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Brooks Davis References: <20040421042453.GA8866@Odin.AC.HMC.Edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: net@freebsd.org Subject: Re: RFC: if_clone overhaul 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: Thu, 22 Apr 2004 14:13:42 -0000 Brooks Davis wrote: > > Please test/review the following patch to the network interface cloneing > code. This code is a major overhaul of the cloning infrastructure. > > The significant include: > - Split the code out into if_clone.[ch]. > - Locked struct if_clone. Derived from work by Maurycy > Pawlowski-Wieronski > - Add a per-cloner match function rather then simply matching names of > the form and . > - Use the match function to allow creation of . > vlan interfaces. The old way is preserved unchanged! > - Also the match function to allow creation of stf(4) interfaces named > stf0, stf, or 6to4. This is the only major user visiable change in > that "ifconfig stf" creates the interface stf rather then stf0 and > does not print "stf0" to stdout. > - Allow destroy functions to fail so they can refuse to delete > interfaces. Currently, we forbid the deletion of interfaces which > were created in the init function, particularly lo0, pflog0, and > pfsync0. In the case of lo0 this was a panic implemenation so it > does not count as a user visiable change. :-) > - Since most interfaces do not need the new functionality, an family of > wrapper functions, ifc_simple_*(), were created to wrap old style > cloner functions. > - The IF_CLONE_INITIALIZER macro is replaced with a new incompatable > IFC_CLONE_INITALIZER and ifc_simple consumers use IFC_SIMPLE_DECLARE > instead. > > TODO: > - Integrate vlan changes into /etc/rc* (add support for interfaces with > '.' in their name). > - Document new vlan syntax in vlan(4). Looks good and I like it! ;-) Some comments: o in net/if_clone.h you can remove the 3rd Regents copyright clause. o in net/if_clone.h, is ## really a legal character in variables? Looks strange for sure! o in net/if_clone.c you can remove the 3rd Regents copyright clause. o how far does the cloning code scale? I'm asking because with the work on the l2tp stuff you'll get machines with possibly 10'000 or more ppp over l2tp connections acting as LAC. o I haven't run the code or applied the patch because I have too many modifications in my tree which I need to get committed first. :-) Good work! -- Andre