[PATCH v3 2/7] Add a general netlink socket parser

Dmitry V. Levin ldv at altlinux.org
Thu Jun 16 13:43:45 UTC 2016


On Thu, Jun 16, 2016 at 01:22:12PM +0000, Fabien Siron wrote:
> Quoting Dmitry V. Levin (2016-06-16 01:36:47)
> > On Wed, Jun 15, 2016 at 12:43:00PM +0000, Fabien Siron wrote:
[...]
> As verbose must be used instead of show_fd_path, the following seems better:
> 
> switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) {

Agreed.

> > > @@ -947,10 +975,11 @@ SYS_FUNC(recv)
> > >               printfd(tcp, tcp->u_arg[0]);
> > >               tprints(", ");
> > >       } else {
> > > -             if (syserror(tcp))
> > > +             if (syserror(tcp)) {
> > 
> > What's this?
> 
> printsockbuf() must be called if there is no syserror. What's wrong with that?

There is an inconsistent change of coding style along with the actual
code change: brackets are added to the "if" part of the statement only.

> > > diff --git a/netlink.c b/netlink.c
> > > new file mode 100644
> > > index 0000000..30116dd
> > > --- /dev/null
> > > +++ b/netlink.c
> > > +static bool
> > > +_decode_netlink(struct tcb *tcp, void *elem_buf, size_t elem_size,
> > 
> > names starting with underscore are reserved and shouldn't be used.
> 
> Do you prefer something like "print_netlink_iov"?

I don't have a strong preference in this case, as I'm now in favour
of extending tprint_iov_upto to handle netlink.


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


More information about the Strace-devel mailing list