Implement outputting of IPv6 addresses in the ippool debug list of tree
type pools (ippool -l -d -t tree). Currently IPv6 in ippool tree type pool handling is partially implemented (meaning it doesn't work). This is the first of a series 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:
parent
d6b431072a
commit
9333d761bc
@ -33,8 +33,30 @@ printpoolnode(np, opts, fields)
|
||||
printmask(np->ipn_addr.adf_family,
|
||||
(u_32_t *)&np->ipn_mask.adf_addr);
|
||||
} else {
|
||||
PRINTF("\tAddress: %s%s", np->ipn_info ? "! " : "",
|
||||
inet_ntoa(np->ipn_addr.adf_addr.in4));
|
||||
#ifdef AF_INET6
|
||||
if (np->ipn_addr.adf_family == AF_INET6) {
|
||||
char buf[INET6_ADDRSTRLEN + 1];
|
||||
const char *str;
|
||||
|
||||
buf[0] = '\0';
|
||||
str = inet_ntop(AF_INET6, &np->ipn_addr.adf_addr.in6,
|
||||
buf, sizeof(buf) - 1);
|
||||
if (str == NULL)
|
||||
str = "???";
|
||||
PRINTF("\tAddress: %s%s", np->ipn_info ? "! " : "",
|
||||
str);
|
||||
} else if (np->ipn_addr.adf_family == AF_INET) {
|
||||
#else
|
||||
if (np->ipn_addr.adf_family == AF_INET) {
|
||||
#endif
|
||||
PRINTF("\tAddress: %s%s", np->ipn_info ? "! " : "",
|
||||
inet_ntoa(np->ipn_addr.adf_addr.in4));
|
||||
} else {
|
||||
PRINTF("\tAddress: family: %d",
|
||||
np->ipn_addr.adf_family);
|
||||
#ifdef AF_INET6
|
||||
}
|
||||
#endif
|
||||
printmask(np->ipn_addr.adf_family,
|
||||
(u_32_t *)&np->ipn_mask.adf_addr);
|
||||
#ifdef USE_QUAD_T
|
||||
|
Loading…
Reference in New Issue
Block a user