Just like r318173, which was for outputting IPv6 addresses in tree

pools, implement outputting of IPv6 addresses in the ippool debug list
of hash type pools (ippool -l -d -t hash). Currently IPv6 in ippool tree
type pool handling is mostly implemented.
This continues theseries of commits to remediate ippool.

This will be MFCed with a yet to be committed series of fixes to ippool
after it has been fully remediated.

PR:		218433
This commit is contained in:
Cy Schubert 2017-05-15 03:39:35 +00:00
parent 7ee662e8d8
commit 344add7203

View File

@ -35,6 +35,31 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
}
printf("\n");
} else if ((opts & OPT_DEBUG) != 0) {
#ifdef AF_INET6
if (ipe.ipe_family == AF_INET6) {
char buf[INET6_ADDRSTRLEN + 1];
const char *str;
buf[0] = '\0';
str = inet_ntop(AF_INET6, &ipe.ipe_addr.in6,
buf, sizeof(buf) - 1);
if (str == NULL)
str = "???";
PRINTF("\t%d\tAddress: %s", hv, str);
printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
ipe.ipe_group);
#ifdef USE_QUAD_T
PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
ipe.ipe_hits, ipe.ipe_bytes);
#else
PRINTF("\tHits: %lu\tBytes: %lu\n",
ipe.ipe_hits, ipe.ipe_bytes);
#endif /* USE_QUAD_T */
} else if (ipe.ipe_family == AF_INET) {
#else
if (ipe.ipe_family == AF_INET) {
#endif /* AF_INET6 */
PRINTF("\t%d\tAddress: %s", hv,
inet_ntoa(ipe.ipe_addr.in4));
printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
@ -46,7 +71,11 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
#else
PRINTF("\tHits: %lu\tBytes: %lu\n",
ipe.ipe_hits, ipe.ipe_bytes);
#endif
#endif /* USE_QUAD_T */
} else {
PRINTF("\tAddress: family: %d\n",
ipe.ipe_family);
}
} else {
putchar(' ');
printip(ipe.ipe_family, (u_32_t *)&ipe.ipe_addr.in4_addr);