diff options
author | Dmitry V. Levin <ldv@strace.io> | 2021-05-08 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2021-05-08 08:00:00 +0000 |
commit | c77403c59d54ab2feead6065a710e318029ea33d (patch) | |
tree | 72c9a1d18813102277da1bdc9c36abeef70fd084 /tests/netlink_sock_diag.c | |
parent | 0b17d6912cf7adbf19aa512cea827b2e635cce66 (diff) | |
download | strace-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.c | 8 |
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 |