[PATCH v4 3/4] nfnetlink: introduce generic netfilter subsystem decoder
Dmitry V. Levin
ldv at altlinux.org
Sat Mar 10 01:26:57 UTC 2018
On Sat, Mar 10, 2018 at 09:19:54AM +0800, Chen Jingpiao wrote:
> On 03/10 03:55, Dmitry V. Levin wrote:
> > On Thu, Mar 08, 2018 at 10:53:46PM +0800, Chen Jingpiao wrote:
> > > * netlink_netfilter.c: Include "nlattr.h".
> > > (decode_netlink_netfilter): Call decode_nlattr.
> > > ---
> > > netlink_netfilter.c | 12 ++++++++++--
> > > 1 file changed, 10 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/netlink_netfilter.c b/netlink_netfilter.c
> > > index a6028a1e5..b6c68120c 100644
> > > --- a/netlink_netfilter.c
> > > +++ b/netlink_netfilter.c
> > > @@ -31,6 +31,7 @@
> > > #ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H
> > >
> > > # include "print_fields.h"
> > > +# include "nlattr.h"
> > >
> > > # include <netinet/in.h>
> > > # include <arpa/inet.h>
> > > @@ -79,8 +80,15 @@ decode_netlink_netfilter(struct tcb *const tcp,
> > > const size_t offset = NLMSG_ALIGN(sizeof(nfmsg));
> > > if (len > offset) {
> > > tprints(", ");
> > > - printstr_ex(tcp, addr + offset,
> > > - len - offset, QUOTE_FORCE_HEX);
> > > + if ((nlmsghdr->nlmsg_type >= NFNL_MSG_BATCH_BEGIN
> > > + && nlmsghdr->nlmsg_type <= NFNL_MSG_BATCH_END)
> >
> > NFNL_MSG_BATCH_BEGIN and NFNL_MSG_BATCH_END were introduced in linux kernel
> > commit v3.13-rc1~105^2~186^2~2, what if strace is being built with older
> > kernel headers?
> >
> > We have fallback definitions for these constants in
> > xlat/nl_netfilter_msg_types.in, but currently they are not available
> > in this file.
>
> Now I want to send a patch like v4.18-173-g4c437e185
> and v4.17-33-gc826fa0f7 to solve this problem.
> And apply it after this patch instead of solve this problem in this patch.
> Do you think this solution is okay?
Yes, I think the move of nl_netfilter_msg_types is OK, but
it should be done before this patch rather than after it.
--
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/20180310/ec50913a/attachment.bin>
More information about the Strace-devel
mailing list