From owner-freebsd-hackers Sat Jun 9 13:24:29 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from Awfulhak.org (gw.Awfulhak.org [217.204.245.18]) by hub.freebsd.org (Postfix) with ESMTP id 0AC3737B401 for ; Sat, 9 Jun 2001 13:24:26 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f59KONt88614; Sat, 9 Jun 2001 21:24:23 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.4/8.11.4) with ESMTP id f59KOMA07577; Sat, 9 Jun 2001 21:24:22 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200106092024.f59KOMA07577@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: Brooks Davis Cc: Brian Somers , Poul-Henning Kamp , hackers@FreeBSD.ORG, brian@Awfulhak.org Subject: Re: cloning network interfaces In-Reply-To: Message from Brooks Davis of "Thu, 07 Jun 2001 16:48:12 PDT." <20010607164812.A32379@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 09 Jun 2001 21:24:22 +0100 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Ok, I've got the quick and dirty way working for testing (a nine line > clone handler works great for that), but I think Brian's suggestion is > probably best for a real solution especialy since it's rather easier to > check for permissions before allowing creation this way. My current > patch lets joe user create 2^15 gif devices by doing "ls /dev/gif###" > 2^15 times because I didn't have a proc structure handy. The other > advantage is that it should be fairly easy to backport to -stable which > is where the project I'm working on this for is currently being developed. > > I think I'll add a to ifconfig function styled after ifmaybeload() that > trys to create interfaces if the user trys to do something with them. > I'm still thinking about the right way to handle creation of new, free > devices, perhaps a syntax like: > > ifconfig gif# > > where ifconfig returns the interface name the way mdconfig does when you > don't specify a unit. If we decied that interfaces that want to grow > this way will have a /dev/if_ device that accepts the appropriate > ioctl(s), that should be fairly easy to implement so it works in all > cases without further hacks to ifconfig. I think it'd be better to use the solaris ``plumb'' keyword. I can't recall how it works (something like ``ifconfig gif0 plumb'' - I haven't got a Solaris machine handy here), but it seemed cleaner, making it more obvious what's being done. An ``unplumb'' keyword may be appropriate for doing the removal. > -- Brooks -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message