From owner-freebsd-hackers Wed Jul 24 3: 5:20 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DB3237B400 for ; Wed, 24 Jul 2002 03:05:16 -0700 (PDT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07A4743E31 for ; Wed, 24 Jul 2002 03:05:16 -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 g6OA5EpO008081 for ; Wed, 24 Jul 2002 03:05:14 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id g6OA5EoG008080 for hackers@freebsd.org; Wed, 24 Jul 2002 03:05:14 -0700 Date: Wed, 24 Jul 2002 03:05:14 -0700 From: Brooks Davis To: hackers@freebsd.org Subject: odd idiom in _attach functions Message-ID: <20020724030514.A7646@Odin.AC.HMC.Edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I was poking around in various nic drivers and I noticed that several of them have what seems to be an odd idiom in their generic attach functions. For instance in sys/dev/ed/if_ed.c in ed_attach(), filling in the interface fields and attaching the interface is protected by and "if (!ifp->if_name)". Can someone explain why this is being done? It doesn't seem to make any sense that this could get called twice for the same device (after all you only attach once). -- 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 --7AUc2qLy4jB3hD7Z 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 iD8DBQE9PnvZXY6L6fI4GtQRAqEtAJsE/6jVbQWvShv74vQkBRLY+tM7+ACgzZ1J gSy2MsvOEclQRp+F5l8eD90= =2wrs -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message