Date: Sat, 09 Jun 2001 21:24:22 +0100 From: Brian Somers <brian@Awfulhak.org> To: Brooks Davis <brooks@one-eyed-alien.net> Cc: Brian Somers <brian@Awfulhak.org>, Poul-Henning Kamp <phk@critter.freebsd.dk>, hackers@FreeBSD.ORG, brian@Awfulhak.org Subject: Re: cloning network interfaces Message-ID: <200106092024.f59KOMA07577@hak.lan.Awfulhak.org> In-Reply-To: Message from Brooks Davis <brooks@one-eyed-alien.net> of "Thu, 07 Jun 2001 16:48:12 PDT." <20010607164812.A32379@Odin.AC.HMC.Edu>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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_<name> 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 <brian@Awfulhak.org> <brian@[uk.]FreeBSD.org> <http://www.Awfulhak.org> <brian@[uk.]OpenBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106092024.f59KOMA07577>