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
[-- Attachment #1 --]
On Thu, Jun 09, 2005 at 10:25:30AM +0200, Maxim Sobolev wrote:
> Hi,
>
> 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():
>
> @@ -282,9 +283,13 @@
> }
> }
>
> - bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
> + bcopy(eaddr, (char *)&GET_ARPCOM(sc)->ac_enaddr, ETHER_ADDR_LEN);
>
> - ifp = GET_IFP(sc);
> + ifp = GET_IFP(sc) = if_alloc(IFT_ETHER);
> + if (ifp == NULL) {
> + printf("%s: can not if_alloc()\n", USBDEVNAME(sc->cdce_dev));
> + USB_ATTACH_ERROR_RETURN;
> + }
> ifp->if_softc = sc;
> if_initname(ifp, "cdce", sc->cdce_unit);
> ifp->if_mtu = ETHERMTU;
> @@ -323,6 +328,7 @@
>
> 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
--
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
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFCqGLhXY6L6fI4GtQRAgEMAKDeENIFYi8flScFRxZ0tG2Dapo3mACeNI9o
9zjNKeE9vqrTpJzVuIZswc0=
=aC7l
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050609154017.GC9171>
