tests/inet-cmsg: use IFINDEX_LO_STR

* tests/inet-cmsg.c (print_pktinfo): Use IFINDEX_LO_STR instead
of hardcoded string.
This commit is contained in:
Дмитрий Левин 2017-08-12 19:27:07 +00:00
parent 0891e131c7
commit 4e82a67f5f

View File

@ -38,9 +38,10 @@
static void
print_pktinfo(const struct cmsghdr *c)
{
printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")"
", ipi_spec_dst=inet_addr(\"127.0.0.1\")"
", ipi_addr=inet_addr(\"127.0.0.1\")}");
printf("IP_PKTINFO, cmsg_data={ipi_ifindex=%s"
", ipi_spec_dst=inet_addr(\"%s\")"
", ipi_addr=inet_addr(\"%s\")}",
IFINDEX_LO_STR, "127.0.0.1", "127.0.0.1");
}
static void