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:
parent
08c0960ad5
commit
17e624cf96
6
msghdr.c
6
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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user