Subject: Re: Moving ethfoo in the main tree
To: Christos Zoulas <>
From: Quentin Garnier <>
List: tech-kern
Date: 12/14/2004 17:48:21
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Dec 14, 2004 at 04:11:02PM +0000, Christos Zoulas wrote:
> In article <>,
> Jason Thorpe <> wrote:
> >-=3D-=3D-=3D-=3D-=3D-
> >
> >
> >On Dec 13, 2004, at 6:58 AM, Manuel Bouyer wrote:
> >
> >> I was also thinking about adding a link2 flag to tun(4) to turn on=20
> >> ethernet
> >> emulation. I don't know how this would play with the ethernet layer.
> >> I think an ethernet device needs to be registered here at creation=20
> >> time,
> >> and can't be attached/detached from the ethernet layer at a later time.
> >> But I didn't look deeply at this.
> >
> >How about using ifmedia to determine the link type to emulate in tun?
> Yes, that would be best.
> >I think it's silly to have tun and ethfoo in the tree... and I think=20
> >ethfoo is a bad name for something that's not merely an example.
> I agree, and I would like to see tun enhanced to encapsulate ethfoo
> (tap) functionality. Can someone summarize the options, their
> advantages/disadvantages, and which OS does what so that we can
> decide what to do?

I'll work on adding tun functionality to ethfoo.

As for what can be done when having an interface that does both:
1. Don't bother and keep them separate.
2. Let the creator of the interface configure it once in either modes.
3. Let the administrator make the interface switch between either

1 is what FreeBSD does.  Linux does 2 and OpenBSD 3.

As for the means of changing mode, Linux does it through an ioctl(),
the one that you're supposed to do to initialize the interface.  You
cannot change the mode after that.

OpenBSD uses the link0 flag, and the switching process destroys the
existing interface and re-creates one with the new mode.

I made some comments on that somewhere else in this thread.

Quentin Garnier - -
"Commala-come-five! / Even when the shadows rise!
To see the world and walk the world / Makes ya glad to be alive."
Susannah's Song, The Dark Tower VI, Stephen King, 2004.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.6 (NetBSD)