From: JingPiao Chen Date: Thu, 10 Aug 2017 01:03:23 +0000 (+0800) Subject: tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE X-Git-Tag: v4.19~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d216d508ec8eefbee3108798988cf66a1d7cbac;p=strace tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE * tests/netlink_route.c (test_nlmsg_done): New function. (main): Use it. --- diff --git a/tests/netlink_route.c b/tests/netlink_route.c index 2d8f0318..0a52dbc5 100644 --- a/tests/netlink_route.c +++ b/tests/netlink_route.c @@ -128,6 +128,17 @@ test_nlmsg_flags(const int fd) (unsigned) sizeof(nlh), sprintrc(rc)); } +static void +test_nlmsg_done(const int fd) +{ + void *const nlh0 = tail_alloc(NLMSG_HDRLEN); + const int num = 0xabcdefad; + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + static void test_rtnl_unspec(const int fd) { @@ -207,6 +218,7 @@ int main(void) test_nlmsg_type(fd); test_nlmsg_flags(fd); + test_nlmsg_done(fd); test_rtnl_unspec(fd); test_rtnl_link(fd);