Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Aug 2002 10:59:03 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        Julian Elischer <julian@elischer.org>
Cc:        Brooks Davis <brooks@one-eyed-alien.net>, Bruce Evans <bde@zeta.org.au>, "M. Warner Losh" <imp@bsdimp.com>, net@FreeBSD.ORG
Subject:   Re: switching to if_xname from if_name and if_unit
Message-ID:  <20020814105903.A8808@Odin.AC.HMC.Edu>
In-Reply-To: <Pine.BSF.4.21.0208141020200.22277-100000@InterJet.elischer.org>; from julian@elischer.org on Wed, Aug 14, 2002 at 10:25:23AM -0700
References:  <20020814095606.A32608@Odin.AC.HMC.Edu> <Pine.BSF.4.21.0208141020200.22277-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--HcAYCG3uE/tztfnV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 14, 2002 at 10:25:23AM -0700, Julian Elischer wrote:
>=20
>=20
> On Wed, 14 Aug 2002, Brooks Davis wrote:
> >=20
> > I'm trying to figure out what the best idiom would be.  While a >15
> > character name seems unlikely, we probably shouldn't trust
> > device_get_nameunit().  In that case, I'm not sure what the best thing
> > to use.  The obvious thing is strlcpy, but I don't think we have that in
> > the kernel.  We could use strncpy with the usual tricks or snprintf.
> > Another option would be something like in if.[ch]:
> >=20
> [...]
>=20
> I'd like to start using symbolic names such as
> "Chicago_sprint-12"
> and=20
> "New_York_uunet-2"
> and
> "San_Francisco_virtella-3"
>=20
> to describe my p2p interfaces..
> note that the last one is 24 characters long

What I was actually refering to was >15 character default device names.
I'm pretty sure anyone who tried to commit a device with a name like
acme_corporation_gigabit_ethernet_controler0 would be taken out back and
shot. :-)  I'd say we should probably be checking of overflow, just on
principle though.

If you want to support 24 character names, you'd have to increase
IFNAMSIZ, probably to 32 characters which would change a lot of structure
sizes.  That's not necessicairly all that bad, but I'm sure there are
some hardcoded 16's in the kernel.  If nothing else, the linux compat
stuff would get weird if you had non-ethernet devices which weren't
unique in the first 15 characters.

IMO, that's a seperate issue for the move to if_xname though it does need
to be decided soon if it's a change we want to make since it would break
binary compatability pretty badly.  I realize that the if_xname change
does have a real effect in that it moves us from sort of freeform
strings to a fixed length field, but I think it mostly just clarfies
an existing limit.  After all, IFNAMSIZ appears 92 times in the kernel
according to glimpse so I'm sure you'd see all sorts of weird bugs if
you set if_name to something really long.

-- Brooks

--=20
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9WppnXY6L6fI4GtQRAtyxAKCtCc/oiB038dMeotzryuuK2liibQCgieNS
3PZ79/wo9cK00aXYBqjbzHE=
=WYyM
-----END PGP SIGNATURE-----

--HcAYCG3uE/tztfnV--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020814105903.A8808>