From owner-freebsd-current@freebsd.org Tue Oct 23 17:04:35 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4D2FECA63 for ; Tue, 23 Oct 2018 17:04:35 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADFA485BB5; Tue, 23 Oct 2018 17:04:34 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w9NH4WjA094838 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Oct 2018 10:04:32 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w9NH4Wbp094837; Tue, 23 Oct 2018 10:04:32 -0700 (PDT) (envelope-from jmg) Date: Tue, 23 Oct 2018 10:04:32 -0700 From: John-Mark Gurney To: Brooks Davis Cc: Rick Macklem , FreeBSD Current , Josh Paetzel Subject: Re: which way to update export_args structure? Message-ID: <20181023170432.GA75530@funkthat.com> Mail-Followup-To: Brooks Davis , Rick Macklem , FreeBSD Current , Josh Paetzel References: <20181003155133.GA57729@spindle.one-eyed-alien.net> <20181008170428.GB9766@spindle.one-eyed-alien.net> <20181022160508.GB45769@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xB0nW4MQa6jZONgY" Content-Disposition: inline In-Reply-To: <20181022160508.GB45769@spindle.one-eyed-alien.net> X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Tue, 23 Oct 2018 10:04:33 -0700 (PDT) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 17:04:35 -0000 --xB0nW4MQa6jZONgY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Brooks Davis wrote this message on Mon, Oct 22, 2018 at 16:05 +0000: > > + switch (len) { > > + case (sizeof(struct oexport_args)): > > + case (sizeof(struct o2export_args)): > > + memset(&export, 0, sizeof(export)); >=20 > I think this is now redundant. >=20 > > + memset(&o2export, 0, sizeof(o2export)); >=20 > This is certainly redundant given that you immediately copy over it. This is not redundant if sizeof oexport_args < sizeof o2export, and len =3D=3D sizeof oexport_args... It zeros out the remaining of the buffer= =2E. > > + memcpy(&o2export, bufp, len); --=20 John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --xB0nW4MQa6jZONgY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJbz1SfXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2MEI1RTRGMTNDNzYyMDZDNjEyMDBCNjAy MDVGMEIzM0REMDA2QURBAAoJECBfCzPdAGratBAQAJJ5iFD1v7pXoqcfux12Zh7R 23ii+X8jMbDICtS1L6OP85Wa1dHHrzTz8h5Ro17Ri9dMPYj0M18/3l7XnUBMBWLt aXqiaCIjBB9eKafHWIbXSbxyxPLrp2H86C2ZPBB4gtcFMxUYNt5rLWLw3NBm5Mz1 GAdxDMBlhIyAPCuFI6F9ioDE2tJNKgz0M0TUvuNRUZO5RocRbH8JD+Ny2nrdcZsl CUx1He9E1xDP/JkRbgdbHY2X0tp2YqWlHjKFrfM0r9rq4pXsPDgDGp6dKY5Pcb9O qREf3Id2c17YtyUKR6W6UyNrbgSOZhRQrc/zWzmNzdjoj2t9pwnzV23sR0McHVuw BOQS4rBU70j3ZdGeqLqWfrvFPUwDNU/Ez3jQ8N2fXnP31hrSClqyjltcTBCyuarM dJ4zyS9XD6UNOZea5sUpPe+x0yqrFzM/UYp/pJaDhqDo+oIcPCQ9tYHE1STVlaYM OGRlBbdoB6ORoX+XQYGojpsTFIL5Wj4KJQcOnPYLd4LYi2BmHaoCJSlHsLxMocvK CkkUHWpmCRSr8uTbkNSW0Ipb7kas5I62SSYRxLH+7sRRYS4IdeuFG9D4wzWVpi5A ZEUMcgbLF6eVRUc81OiPu55bsfSooBFY+l5PsZapOVfSav7HL2Eto7DkeJUElCb+ qPlXiBwJ6KincWDNn5+a =quRR -----END PGP SIGNATURE----- --xB0nW4MQa6jZONgY--