[PATCH 02/27] netlink: add a basic parser of NETLINK_CRYPTO messages

Dmitry V. Levin ldv at altlinux.org
Sun Jul 23 09:02:35 UTC 2017


On Sun, Jul 23, 2017 at 04:33:36PM +0800, JingPiao Chen wrote:
> On Sat, Jul 22, 2017 at 09:53:37PM +0300, Dmitry V. Levin wrote:
> > On Sat, Jul 22, 2017 at 08:43:32PM +0800, JingPiao Chen wrote:
> [...]
> > > diff --git a/defs.h b/defs.h
> > > index 4048915..9d99575 100644
> > > --- a/defs.h
> > > +++ b/defs.h
> > > @@ -711,6 +711,9 @@ typedef bool (*netlink_decoder_t)(struct tcb *,
> const struct nlmsghdr *,
> > >  extern bool \
> > >  decode_netlink_ ## name(struct tcb *, const struct nlmsghdr *, \
> > >   kernel_ulong_t addr, unsigned int len)
> > > +#ifdef HAVE_LINUX_CRYPTOUSER_H
> > > +DECL_NETLINK(crypto);
> > > +#endif
> > >  DECL_NETLINK(selinux);
> > >  DECL_NETLINK(sock_diag);
> >
> > Why decode_netlink_crypto declaration is ifdef'ed?
> 
> NETLINK_CRYPTO instroduced by linux kernel commit v3.0-7152-ga38f790.
> netlink_crypto.c have a global guard, decode_netlink_crypto be compiler
> only when have linux/cryptouser.h.

That's clear, but is there any harm in declaring a function
that is not going to be defined?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170723/447fcd64/attachment.bin>


More information about the Strace-devel mailing list