From owner-freebsd-net Wed Aug 14 10:59:15 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83A9237B400 for ; Wed, 14 Aug 2002 10:59:09 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1EBA43E3B for ; Wed, 14 Aug 2002 10:59:08 -0700 (PDT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.3/8.12.3) with ESMTP id g7EHx4wu011291; Wed, 14 Aug 2002 10:59:04 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id g7EHx4g1011290; Wed, 14 Aug 2002 10:59:04 -0700 Date: Wed, 14 Aug 2002 10:59:03 -0700 From: Brooks Davis To: Julian Elischer Cc: Brooks Davis , Bruce Evans , "M. Warner Losh" , net@FreeBSD.ORG Subject: Re: switching to if_xname from if_name and if_unit Message-ID: <20020814105903.A8808@Odin.AC.HMC.Edu> References: <20020814095606.A32608@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from julian@elischer.org on Wed, Aug 14, 2002 at 10:25:23AM -0700 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --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