From 71e05be60a95c833c4b244510cf30a1b0f5afdb4 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 24 Jun 2016 01:30:25 +0000 Subject: [PATCH] net.c: fix printing field names of struct sockaddr_nl * net.c (print_sockaddr_data_nl): Change "pid" to "nl_pid", "groups" to "nl_groups". Print sockaddr_nl.nl_groups using %#08x format. * tests/net-yy-netlink.c (main): Update. --- net.c | 3 ++- tests/net-yy-netlink.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/net.c b/net.c index 651a1d05..a5d9ee44 100644 --- a/net.c +++ b/net.c @@ -196,7 +196,8 @@ print_sockaddr_data_nl(const void *const buf, const int addrlen) { const struct sockaddr_nl *const sa_nl = buf; - tprintf("pid=%d, groups=%08x", sa_nl->nl_pid, sa_nl->nl_groups); + tprintf("nl_pid=%d, nl_groups=%#08x", + sa_nl->nl_pid, sa_nl->nl_groups); } static void diff --git a/tests/net-yy-netlink.c b/tests/net-yy-netlink.c index e52cfedd..64d0efca 100644 --- a/tests/net-yy-netlink.c +++ b/tests/net-yy-netlink.c @@ -66,13 +66,13 @@ main(void) if (bind(fd, sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_NETLINK" - ", pid=%u, groups=00000000}, %u) = 0\n", + ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", fd, inode, magic, (unsigned) *len); if (getsockname(fd, sa, len)) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_NETLINK" - ", pid=%u, groups=00000000}, [%u]) = 0\n", + ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", fd, magic, magic, (unsigned) *len); if (close(fd)) -- 2.40.0