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

Dmitry V. Levin ldv at altlinux.org
Thu Jun 16 13:38:06 UTC 2016


On Thu, Jun 16, 2016 at 01:26:15PM +0000, Fabien Siron wrote:
> Quoting Dmitry V. Levin (2016-06-16 10:08:22)
> > On Thu, Jun 16, 2016 at 04:36:47AM +0300, Dmitry V. Levin wrote:
> > > On Wed, Jun 15, 2016 at 12:43:00PM +0000, Fabien Siron wrote:
> > [...]
> > > > +void
> > > > +decode_netlink_iov(struct tcb *tcp, unsigned long len, unsigned long addr,
> > > > +              unsigned long data_size)
> > > > +{
> > > > +   unsigned long iov[2];
> > > > +
> > > > +   print_array(tcp, addr, len, iov, current_wordsize * 2,
> > > > +               umoven_or_printaddr, _decode_netlink, 0);
> > > > +}
> > > 
> > > data_size shouldn't be ignored, see tprint_iov_upto for example
> > > how to take it into account.
> > 
> > Alternatively, rather than making decode_netlink_iov work like
> > tprint_iov_upto, you can extend tprint_iov_upto to print netlink related
> > data.  For example, "decode_iov" argument of tprint_iov_upto can be turned
> > from de-facto boolean printaddr/printstr value into enum.
> 
> I think that this is a good idea but as all the functions that call
> tprint_iov_upto() or tprint_iov() must be patched, it's maybe better to do
> that as a seperated commit (maybe a future improvement).

Yes, a separate commit is a good idea.


-- 
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/64e28ebb/attachment.bin>


More information about the Strace-devel mailing list