From 7d216d508ec8eefbee3108798988cf66a1d7cbac Mon Sep 17 00:00:00 2001 From: JingPiao Chen Date: Thu, 10 Aug 2017 09:03:23 +0800 Subject: [PATCH] tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE * tests/netlink_route.c (test_nlmsg_done): New function. (main): Use it. --- tests/netlink_route.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- 2.40.0