>>>>> On Mon, 11 Jun 2001 14:20:31 -0700
>>>>> Brooks Davis <[EMAIL PROTECTED]> said:

brooks> On Sun, Jun 10, 2001 at 11:29:07PM +0900, Hajimu UMEMOTO wrote:
> I think it is not BSD network way.  Recent NetBSD has network
> interface cloning.  It uses SIOCIFCREATE and SIOCIFDESTROY.  It may
> good to port it to FreeBSD.

brooks> I've looked it over and I generally like it.  There is one problem
brooks> though.  That's the requirement that you use static units.  The problem
brooks> with this is that it forces you to implement free unit scanning in
brooks> userland if you just want to create a unit and don't care what it is.
brooks> If you have to do this, and things are being changed at any kind of
brooks> significant rate, you have race condition between scanning the
brooks> interface list for a free unit and trying to allocate it.  This race can
brooks> theoreticaly lead to starvation.

I see.

brooks> My proposed solution is threefold.  First, change the ifc_create pointer's
brooks> type to:

brooks>         int     (*ifc_create)(struct if_clone *, int *);

brooks> so you can return a unit if the caller requests a wildcard unit (by
brooks> passing -1).  Second, move unit management in to the driver rather then
brooks> just using ifunit in if_clone_create.  Drivers could choose to implement
brooks> wildcarding or not and if not could simply use ifunit for their test.
brooks> Third, make if_clone_lookup treat names like "gif#" as a wildcard
brooks> request and set unit to -1 as appropriate.  These changes break
brooks> compatability with NetBSD slightly, but it's just a few lines to convert
brooks> an existing NetBSD clone_create handler to this style and it could
brooks> easily be handled with #ifdef's.

brooks> Thoughts, comments, objections?

I like your idea.
I'm serving tunnel broker using DTCP (Dynamic Tunnel Configuration
Protocol) in our ISP.  So, I'm grad if we have dynamic gif creation,
too.

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
[EMAIL PROTECTED]  [EMAIL PROTECTED]  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to