Replace AF_INET6 ifdefs with USE_INET6 ifdefs. This is more consistent

and guaranteed to build everywhere in ipfilter.

Not all of this commit can be MFCed. Some is original code while others
are not.
This commit is contained in:
Cy Schubert 2017-06-23 02:42:04 +00:00
parent 3dfcef9d29
commit 43988e3f50
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320257
5 changed files with 6 additions and 8 deletions

View File

@ -4,7 +4,7 @@ const char *familyname(int family)
{
if (family == AF_INET)
return "inet";
#ifdef AF_INET6
#ifdef USE_INET6
if (family == AF_INET6)
return "inet6";
#endif

View File

@ -35,7 +35,7 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
}
printf("\n");
} else if ((opts & OPT_DEBUG) != 0) {
#ifdef AF_INET6
#ifdef USE_INET6
if (ipe.ipe_family == AF_INET6) {
char buf[INET6_ADDRSTRLEN + 1];
const char *str;
@ -59,7 +59,7 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
} else if (ipe.ipe_family == AF_INET) {
#else
if (ipe.ipe_family == AF_INET) {
#endif /* AF_INET6 */
#endif /* USE_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);

View File

@ -25,7 +25,7 @@ printip(family, addr)
else
PRINTF("%s", inet_ntoa(ipa));
}
#ifdef AF_INET6
#ifdef USE_INET6
else if (family == AF_INET6) {
char buf[INET6_ADDRSTRLEN + 1];
const char *str;

View File

@ -33,7 +33,7 @@ printpoolnode(np, opts, fields)
printmask(np->ipn_addr.adf_family,
(u_32_t *)&np->ipn_mask.adf_addr);
} else {
#ifdef AF_INET6
#ifdef USE_INET6
if (np->ipn_addr.adf_family == AF_INET6) {
char buf[INET6_ADDRSTRLEN + 1];
const char *str;
@ -54,9 +54,7 @@ printpoolnode(np, opts, fields)
} else {
PRINTF("\tAddress: family: %d\n",
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

View File

@ -2303,7 +2303,7 @@ makepool(list)
for (n = top, a = list; (n != NULL) && (a != NULL); a = a->al_next) {
if (use_inet6 == 1) {
#ifdef AF_INET6
#ifdef USE_INET6
n->ipn_addr.adf_family = AF_INET6;
n->ipn_addr.adf_addr = a->al_i6addr;
n->ipn_addr.adf_len = offsetof(addrfamily_t,