From owner-cvs-src@FreeBSD.ORG Sat Apr 24 15:51:50 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90B1416A4CE; Sat, 24 Apr 2004 15:51:50 -0700 (PDT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C871143D1F; Sat, 24 Apr 2004 15:51:49 -0700 (PDT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i3OMuf8V083272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 25 Apr 2004 01:56:43 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i3OMpuWv091370; Sun, 25 Apr 2004 01:51:56 +0300 (EEST) (envelope-from ru) Date: Sun, 25 Apr 2004 01:51:55 +0300 From: Ruslan Ermilov To: Luigi Rizzo Message-ID: <20040424225155.GC35913@ip.net.ua> References: <200404242224.i3OMOmpK033235@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KDt/GgjP6HVcx58l" Content-Disposition: inline In-Reply-To: <200404242224.i3OMOmpK033235@repoman.freebsd.org> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net if.c if_vlan.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 22:51:50 -0000 --KDt/GgjP6HVcx58l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 24, 2004 at 03:24:48PM -0700, Luigi Rizzo wrote: > luigi 2004/04/24 15:24:48 PDT >=20 > FreeBSD src repository >=20 > Modified files: > sys/net if.c if_vlan.c=20 > Log: > arpcom untangling: > =20 > consistently with the rest of the code, use IFP2AC(ifp) to access > the arpcom structure given the ifp. > =20 > In this case also fix a difference in assumptions WRT the rest of > the net/ sources: it is not the 'struct *softc' that starts with a > 'struct arpcom', but a 'struct arpcom' that starts with a > 'struct ifnet' > =20 Hmm, actually both statements are true. From if_var.h: /* * NB: For FreeBSD, it is assumed that each NIC driver's softc starts with * one of these structures, typically held within an arpcom structure. * * struct _softc { * struct arpcom { * struct ifnet ac_if; * ... * } ; * ... * }; * * The assumption is used in a number of places, including many * files in sys/net, device drivers, and sys/dev/mii.c:miibus_attach(). * * Unfortunately devices' softc are opaque, so we depend on this layout * to locate the struct ifnet from the softc in the generic code. * */ But I think your intention is to only leave the latter; in this case, please care to update this comment in if_var.h. It came very handy when I fixed the problem in sys/netgraph/ng_eiface.c, rev. 1.11, and I'll sure look here again next time I do something similar. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --KDt/GgjP6HVcx58l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAiu+LUkv4P6juNwoRAsNoAJ4o35asxuY7I4nfq2sZPRY3eia54gCeJQZw FE1Ovks9i1dPetvDVW//Qkc= =ELUO -----END PGP SIGNATURE----- --KDt/GgjP6HVcx58l--