]> granicus.if.org Git - strace/commitdiff
msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 28 Jun 2016 22:25:10 +0000 (22:25 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 30 Jun 2016 22:10:28 +0000 (22:10 +0000)
* msghdr.c (print_cmsg_ip_ttl, print_cmsg_ip_tos,
print_cmsg_ip_checksum): Print struct cmsghdr.cmsg_data value as an
array element.
* tests/inet-cmsg.c (print_ttl, print_tos): Update expected output.

msghdr.c
tests/inet-cmsg.c

index 66e5a70483a0289b88a65537b9c347e5a3595ced..bad3357ee01e8adfb1cb5b50f3a5883fba9842d3 100644 (file)
--- a/msghdr.c
+++ b/msghdr.c
@@ -124,7 +124,7 @@ print_cmsg_ip_ttl(struct tcb *tcp, const void *cmsg_data,
        if (sizeof(*ttl) > data_len)
                return;
 
-       tprintf(", cmsg_data={ttl=%u}", *ttl);
+       tprintf(", cmsg_data=[%u]", *ttl);
 }
 
 static void
@@ -136,7 +136,7 @@ print_cmsg_ip_tos(struct tcb *tcp, const void *cmsg_data,
        if (sizeof(*tos) > data_len)
                return;
 
-       tprintf(", cmsg_data={tos=%x}", *tos);
+       tprintf(", cmsg_data=[%#x]", *tos);
 }
 
 static void
@@ -148,7 +148,7 @@ print_cmsg_ip_checksum(struct tcb *tcp, const void *cmsg_data,
        if (sizeof(*csum) > data_len)
                return;
 
-       tprintf(", cmsg_data={csum=%u}", *csum);
+       tprintf(", cmsg_data=[%u]", *csum);
 }
 
 static void
index b1d655a220c3f2850f2db193183815c91fabda8f..5b020417c225cf7ed0d9439ce799e06eca722de2 100644 (file)
@@ -48,7 +48,7 @@ print_ttl(const struct cmsghdr *c)
 {
        const unsigned int *ttl = (const unsigned int *) CMSG_DATA(c);
 
-       printf("IP_TTL, cmsg_data={ttl=%u}", *ttl);
+       printf("IP_TTL, cmsg_data=[%u]", *ttl);
 }
 
 static void
@@ -56,7 +56,7 @@ print_tos(const struct cmsghdr *c)
 {
        const uint8_t *tos = (const uint8_t *) CMSG_DATA(c);
 
-       printf("IP_TOS, cmsg_data={tos=%x}", *tos);
+       printf("IP_TOS, cmsg_data=[%#x]", *tos);
 }
 
 static void