Date: Sat, 2 Nov 2013 09:32:45 +0000 From: Mark R V Murray <mark@grondar.org> To: Adrian Chadd <adrian@freebsd.org> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Bruce Evans <brde@optusnet.com.au> Subject: Re: svn commit: r257535 - head/sys/netgraph Message-ID: <76BC3F76-ED5E-42F0-BCCE-271EA723698E@grondar.org> In-Reply-To: <CAJ-VmokeP5Z2d7jZ-j-Thrh_VuQBKGpKC9nWG%2BQfhR0f6wzF9w@mail.gmail.com> References: <201311020011.rA20BchL020170@svn.freebsd.org> <20131102151309.A1102@besplex.bde.org> <CAJ-VmokeP5Z2d7jZ-j-Thrh_VuQBKGpKC9nWG%2BQfhR0f6wzF9w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 2 Nov 2013, at 05:53, Adrian Chadd <adrian@freebsd.org> wrote: > Hm! A good question! >=20 > On 1 November 2013 22:22, Bruce Evans <brde@optusnet.com.au> wrote: >=20 >>> if (harvest.point_to_point) >>> - random_harvest(&(m->m_data), 12, 2, RANDOM_NET_NG); >>=20 >>=20 >> '&(m->m_data)' is not just a pair of style bugs. It gives address of >> the pointer (somewhere in the mbuf header), not the address of = pointed- >> to data, so the randomness was almost null. The style bugs are >> excessive parentheses and chumminess with the implementation (non-use >> of the accessor function mtod()). >>=20 >>=20 >>> + random_harvest(mtod(m, const void *), 12, 2, >>> RANDOM_NET_NG); >>=20 >>=20 >> Presumably you really do want to harvest the pointed-to data and = there >> are at least 12 bytes of it, so the semantic fix isn't backwards or a >> buffer overrun. >>=20 >=20 >=20 > Mark - did you initially mean the address of the mbuf m_data pointer, > or the data payload itself? As Bruce says - the address of payload data itself. We don=92t have = 12-byte pointers in FreeBSD. :-) M --=20 Mark R V Murray --Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - http://gpgtools.org iQCVAwUBUnTGwt58vKOKE6LNAQpBTAQAkGQL2BwjbjUAOqhUGilLE6caZuz40QmX kdHOrG3tyrVxQDVWbbkDEACpQ7ih9R4fsGPL/nA24KcS1N8bYKwXPrN3axGYfLMA OLgi5rX3yP4yw51rctQVUee6zCoLDeb36afL//h1JtQDIUg01e85PAQieNASyAG/ 73om+84TZe8= =a0EQ -----END PGP SIGNATURE----- --Apple-Mail=_D4051F9E-885D-4EA1-864C-1D8BE058937F--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?76BC3F76-ED5E-42F0-BCCE-271EA723698E>