On 4 June 2017 at 17:56, Dmitry V. Levin <l...@altlinux.org> wrote:
> On Sun, Jun 04, 2017 at 03:57:08PM +0800, JingPiao Chen wrote:
> > On Fri, Jun 02, 2017 at 06:25:28PM +0300, Dmitry V. Levin wrote:
> > > On Fri, May 05, 2017 at 06:21:17PM +0800, JingPiao Chen wrote:
[...]
> > > I suggest implementing a default decoder of NLMSG_DONE messages that
> > > would print the integer in case of len == sizeof(int) and fall back
> > > to  printstrn for other lengths.
> >
> > I updated the patch. default decoder[1]:
>
> Thanks.
>
> > diff --git a/netlink.c b/netlink.c
> > index 678343c..104a65f 100644
> > --- a/netlink.c
> > +++ b/netlink.c
> > @@ -120,6 +120,12 @@ decode_payload(struct tcb *const tcp,
> >   if (nlmsghdr->nlmsg_type == NLMSG_ERROR) {
> >   decode_nlmsgerr(tcp, addr, len);
> >   return;
> > + } else if (nlmsghdr->nlmsg_type == NLMSG_DONE && len == sizeof(int)) {
> > + int total_len;
>
> btw, why do you call it total_len?  This integer can contain anything.

My mistake, now total_len is not a good name, I renamed it to num.

--
JingPiao Chen
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to