From owner-freebsd-net@FreeBSD.ORG Thu Jun 9 15:40:20 2005 Return-Path: X-Original-To: net@FreeBSD.ORG 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 118DA16A41C; Thu, 9 Jun 2005 15:40:20 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE32143D4C; Thu, 9 Jun 2005 15:40:19 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j59FeIQw012531; Thu, 9 Jun 2005 08:40:18 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j59FeI2Y012530; Thu, 9 Jun 2005 08:40:18 -0700 Date: Thu, 9 Jun 2005 08:40:18 -0700 From: Brooks Davis To: Maxim Sobolev Message-ID: <20050609154017.GC9171@odin.ac.hmc.edu> References: <20050609064452.GC1595@odin.ac.hmc.edu> <20050609082530.GA44274@www.portaone.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9Ek0hoCL9XbhcSqy" Content-Disposition: inline In-Reply-To: <20050609082530.GA44274@www.portaone.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: current@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: HEADSUP: internal network interface changes X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2005 15:40:20 -0000 --9Ek0hoCL9XbhcSqy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 09, 2005 at 10:25:30AM +0200, Maxim Sobolev wrote: > Hi, >=20 > I've noticed that in some cases you have removed bcopy() > into arpcom.ac_enaddr completely, while in some others > have modified it to use IFP2AC(). I wonder if it's a mistake > or if there is some logic behind that. Good catch, these are bugs. I'll do another sweep. The problems is that I did the inital sweep based on some macros and not quite everything was converted. > Also, it looks like in cdce(4) driver you are referencing > if_softc before it's been assigned by if_alloc(): >=20 > @@ -282,9 +283,13 @@ > } > } > =20 > - bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN); > + bcopy(eaddr, (char *)&GET_ARPCOM(sc)->ac_enaddr, ETHER_ADDR_LEN); > =20 > - ifp =3D GET_IFP(sc); > + ifp =3D GET_IFP(sc) =3D if_alloc(IFT_ETHER); > + if (ifp =3D=3D NULL) { > + printf("%s: can not if_alloc()\n", USBDEVNAME(sc->cdce_dev)); > + USB_ATTACH_ERROR_RETURN; > + } > ifp->if_softc =3D sc; > if_initname(ifp, "cdce", sc->cdce_unit); > ifp->if_mtu =3D ETHERMTU; > @@ -323,6 +328,7 @@ >=20 > GET_ARPCOM(sc) basically dereferences sc->cdce_ifp, which isn't > initialized before if_alloc() on the next line. Yup, I got tripped up becuase this doesn't use the macro I introduced. Thanks for the review! -- 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 --9Ek0hoCL9XbhcSqy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCqGLhXY6L6fI4GtQRAgEMAKDeENIFYi8flScFRxZ0tG2Dapo3mACeNI9o 9zjNKeE9vqrTpJzVuIZswc0= =aC7l -----END PGP SIGNATURE----- --9Ek0hoCL9XbhcSqy--