From owner-freebsd-net@freebsd.org Tue Apr 7 17:45:24 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4FEFA277815 for ; Tue, 7 Apr 2020 17:45:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 48xZYw0vCZz41cZ for ; Tue, 7 Apr 2020 17:45:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by mailman.nyi.freebsd.org (Postfix) id 1C685277813; Tue, 7 Apr 2020 17:45:24 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C17A277811; Tue, 7 Apr 2020 17:45:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48xZYv33Rzz41cG; Tue, 7 Apr 2020 17:45:23 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9ADCD3C0199; Tue, 7 Apr 2020 17:45:22 +0000 (UTC) Date: Tue, 7 Apr 2020 17:45:22 +0000 From: Brooks Davis To: Hans Petter Selasky Cc: Poul-Henning Kamp , arch@freebsd.org, net@freebsd.org Subject: Re: additional ifreq accessors? Message-ID: <20200407174522.GC72584@spindle.one-eyed-alien.net> References: <20200407172151.GB72584@spindle.one-eyed-alien.net> <62336.1586280397@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DIOMP1UsTsWJauNi" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 48xZYv33Rzz41cG X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-5.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; IP_SCORE(-3.63)[ip: (-9.53), ipnet: 199.48.128.0/22(-4.75), asn: 36236(-3.81), country: US(-0.05)] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2020 17:45:24 -0000 --DIOMP1UsTsWJauNi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 07, 2020 at 07:32:37PM +0200, Hans Petter Selasky wrote: > On 2020-04-07 19:26, Poul-Henning Kamp wrote: > > -------- > > In message <20200407172151.GB72584@spindle.one-eyed-alien.net>, Brooks = Davis writes: > >=20 > >> My question for the lists is: should we adopt the > >> more-technically-correct accessors in FreeBSD or stick with > >> slightly-cheaper and more conventional aliasing approach[0]? > >=20 > > The accessors buys us much more code-isolation, so that would be my vot= e. > >=20 >=20 > Is there a reason for using "void *" here? >=20 > char *ifr_addr_get_data(void *ifrp); Because the type is unknown at this point (it may be struct ifreq or struct ifreq32 (or in CheriBSD struct ifreq64)). By using "void *" here we avoid the need to insert a wrong cast. -- Brooks --DIOMP1UsTsWJauNi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJejLwxAAoJEKzQXbSebgfA6+8IAIYFrD81n/WNk0RSBzd1nxK3 TErSKOycIHe7/v6D7DUd0o9fSco7vIR7wLMbEmMkp/10ceNhD0/FlbSc1FTeqGL9 B7LiEH7pN9eKnuUqKZX/UbrAs2OAinxxNmvO4a0uQ/x72gp00Z0UqjYAM8gGCJl8 McqXdwEjY5VFFMdPywLC0SR1BiuExOghYHgpAAVa+P2mFYx+7AY+m2DsR0gJ4ZzE qhcF6IpapYJ4yKzcz9vRz10C9v22fZngz49ibmHxe0u0plFqKd3B/RTiELcvvs4K QeNd+GBjqj3djeipFHVo8YGv5kWpaq13Yl3ldXXFIkGc5ADaHoiSBD1PzeYFr1U= =80lf -----END PGP SIGNATURE----- --DIOMP1UsTsWJauNi--