msghdr.c: fix representation of integer struct cmsghdr.cmsg_data values

* 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.
This commit is contained in:
Дмитрий Левин 2016-06-28 22:25:10 +00:00
parent 08c0960ad5
commit 17e624cf96
2 changed files with 5 additions and 5 deletions

View File

@ -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

View 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