[PATCH v2 8/8] tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages

JingPiao Chen chenjingpiao at gmail.com
Fri Jun 16 09:00:49 UTC 2017


On Fri, Jun 16, 2017 at 04:07:10AM +0300, Dmitry V. Levin wrote:
> On Thu, Jun 15, 2017 at 12:30:54PM +0800, JingPiao Chen wrote:
> > * tests/netlink_sock_diag.c: Include <linux/smc_diag.h>.
> > (SMC_ACTIVE): New macro.
> > (test_smc_diag_req, test_smc_diag_msg): New functions.
> > (main): Use them.
>
> Thanks, applied with a few changes.

Thank you for your detailed reply.
I have rebased my code[1]. Please have a look, and give me some feedback,
Do I need to redesign netlink attribute data decode[2]? Like:

typedef (*nla_decoder_t)(struct tcb *,
kernel_ulong_t addr,
kernel_ulong_t len,
void *opaque_data);
static const nla_decoder_t unix_nla_decoders[] = {
[UNIX_DIAG_PEER] = decode_nla_u32,
[UNIX_DIAG_ICONS] = decode_unix_diag_icons
};
decode_nlattr(tcp, addr, len, sizeof(msg), unix_diag_attrs,
     "UNIX_DIAG_???", ARRAY_SIZE(unix_nla_decoders),
     unix_nla_decoders, NULL);
Thank you.

[1]https://github.com/ppiao/strace
[2]
https://github.com/ppiao/strace/commit/47ee4e43658b3db9c57bcd3857c51df0585f526e

--
JingPiao Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170616/a44a92c1/attachment.html>


More information about the Strace-devel mailing list