Date: Thu, 9 Jun 2005 08:40:18 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Maxim Sobolev <sobomax@portaone.com> Cc: current@FreeBSD.ORG, net@FreeBSD.ORG Subject: Re: HEADSUP: internal network interface changes Message-ID: <20050609154017.GC9171@odin.ac.hmc.edu> In-Reply-To: <20050609082530.GA44274@www.portaone.com> References: <20050609064452.GC1595@odin.ac.hmc.edu> <20050609082530.GA44274@www.portaone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050609154017.GC9171>