additional ifreq accessors?
Brooks Davis
brooks at freebsd.org
Tue Apr 7 17:45:24 UTC 2020
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 at spindle.one-eyed-alien.net>, Brooks Davis writes:
> >
> >> 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]?
> >
> > The accessors buys us much more code-isolation, so that would be my vote.
> >
>
> Is there a reason for using "void *" here?
>
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20200407/839aef10/attachment.sig>
More information about the freebsd-net
mailing list