summaryrefslogtreecommitdiff
path: root/tests/netlink_sock_diag.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2021-05-08 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2021-05-08 08:00:00 +0000
commitc77403c59d54ab2feead6065a710e318029ea33d (patch)
tree72c9a1d18813102277da1bdc9c36abeef70fd084 /tests/netlink_sock_diag.c
parent0b17d6912cf7adbf19aa512cea827b2e635cce66 (diff)
downloadstrace-c77403c59d54ab2feead6065a710e318029ea33d.tar.gz
netlink_sock_diag: give a name to the nameless field of the artificial structure
* src/netlink_sock_diag.c (decode_family): When printing the rest of the artificial structure as a string, give it a name so it would look like a proper structure. * tests/netlink_sock_diag.c (test_odd_family_req, test_odd_family_msg): Update expected output.
Diffstat (limited to 'tests/netlink_sock_diag.c')
-rw-r--r--tests/netlink_sock_diag.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/netlink_sock_diag.c b/tests/netlink_sock_diag.c
index 69ef9e429..cdc9bfe01 100644
--- a/tests/netlink_sock_diag.c
+++ b/tests/netlink_sock_diag.c
@@ -141,7 +141,7 @@ test_odd_family_req(const int fd)
SOCK_DIAG_BY_FAMILY,
NLM_F_REQUEST,
sizeof(buf), buf, sizeof(buf),
- printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}"));
+ printf("{family=AF_UNSPEC, data=\"\\x31\\x32\\x33\\x34\"}"));
/* unknown family and string */
family = 0xfd;
@@ -151,7 +151,7 @@ test_odd_family_req(const int fd)
NLM_F_REQUEST,
sizeof(buf), buf, sizeof(buf),
printf("{family=%#x /* AF_??? */"
- ", \"\\x31\\x32\\x33\\x34\"}", family));
+ ", data=\"\\x31\\x32\\x33\\x34\"}", family));
}
static void
@@ -187,7 +187,7 @@ test_odd_family_msg(const int fd)
TEST_NETLINK(fd, nlh0,
SOCK_DIAG_BY_FAMILY, NLM_F_DUMP,
sizeof(buf), buf, sizeof(buf),
- printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}"));
+ printf("{family=AF_UNSPEC, data=\"\\x31\\x32\\x33\\x34\"}"));
/* unknown family and string */
family = 0xfd;
@@ -196,7 +196,7 @@ test_odd_family_msg(const int fd)
SOCK_DIAG_BY_FAMILY, NLM_F_DUMP,
sizeof(buf), buf, sizeof(buf),
printf("{family=%#x /* AF_??? */"
- ", \"\\x31\\x32\\x33\\x34\"}", family));
+ ", data=\"\\x31\\x32\\x33\\x34\"}", family));
}
static void