Subject: Re: Moving ethfoo in the main tree
To: Christos Zoulas <christos@zoulas.com>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 12/14/2004 17:48:21
--gw4vLALk08fVJy3V
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 <5F935DB2-4DE5-11D9-8566-000A957650EC@shagadelic.org>,
> Jason Thorpe <thorpej@shagadelic.org> 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?
>=20
> Yes, that would be best.
>=20
> >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.
>=20
> 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
   modes.

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.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"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.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQb8ZVdgoQloHrPnoAQLpiQgAujkFHkGnxVAWwEbNx/EQO7tBl9PH3+tR
8HRDbFmn/PpWZUH8i6T2459mIHROR6nUJDH1TNiC3XRH9PKDoME4etXBfdutF4eu
zy9Tv00YjABboR/kBxl/t3eqkX1UgZ4e1rEwaMJG7qZuNVSW8Y7eMph+95RhxjC6
WJZJr0Q6YZa2qBM5POPJWqLcYi24aEqm/ybLXO5uBWWPOkcmEml8pAc3nSBfh7ap
Kqi6dYkR2CEYWNzZNXEmzkkG9UOv8AO0974mQYaXQF24AKWJUUTElNDoEk13GyPg
uBNrCo/8f2vNPVNXJ2fOHymg3m6gpgDBFB2WQZzdTQ2AMFAHDN+OMg==
=scwi
-----END PGP SIGNATURE-----

--gw4vLALk08fVJy3V--