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:
parent
3dfcef9d29
commit
43988e3f50
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=320257
@ -4,7 +4,7 @@ const char *familyname(int family)
|
|||||||
{
|
{
|
||||||
if (family == AF_INET)
|
if (family == AF_INET)
|
||||||
return "inet";
|
return "inet";
|
||||||
#ifdef AF_INET6
|
#ifdef USE_INET6
|
||||||
if (family == AF_INET6)
|
if (family == AF_INET6)
|
||||||
return "inet6";
|
return "inet6";
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,7 +35,7 @@ printhashnode(iph, ipep, copyfunc, opts, fields)
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
} else if ((opts & OPT_DEBUG) != 0) {
|
} else if ((opts & OPT_DEBUG) != 0) {
|
||||||
#ifdef AF_INET6
|
#ifdef USE_INET6
|
||||||
if (ipe.ipe_family == AF_INET6) {
|
if (ipe.ipe_family == AF_INET6) {
|
||||||
char buf[INET6_ADDRSTRLEN + 1];
|
char buf[INET6_ADDRSTRLEN + 1];
|
||||||
const char *str;
|
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) {
|
||||||
#else
|
#else
|
||||||
if (ipe.ipe_family == AF_INET) {
|
if (ipe.ipe_family == AF_INET) {
|
||||||
#endif /* AF_INET6 */
|
#endif /* USE_INET6 */
|
||||||
PRINTF("\t%d\tAddress: %s", hv,
|
PRINTF("\t%d\tAddress: %s", hv,
|
||||||
inet_ntoa(ipe.ipe_addr.in4));
|
inet_ntoa(ipe.ipe_addr.in4));
|
||||||
printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
|
printmask(ipe.ipe_family, (u_32_t *)&ipe.ipe_mask.in4_addr);
|
||||||
|
@ -25,7 +25,7 @@ printip(family, addr)
|
|||||||
else
|
else
|
||||||
PRINTF("%s", inet_ntoa(ipa));
|
PRINTF("%s", inet_ntoa(ipa));
|
||||||
}
|
}
|
||||||
#ifdef AF_INET6
|
#ifdef USE_INET6
|
||||||
else if (family == AF_INET6) {
|
else if (family == AF_INET6) {
|
||||||
char buf[INET6_ADDRSTRLEN + 1];
|
char buf[INET6_ADDRSTRLEN + 1];
|
||||||
const char *str;
|
const char *str;
|
||||||
|
@ -33,7 +33,7 @@ printpoolnode(np, opts, fields)
|
|||||||
printmask(np->ipn_addr.adf_family,
|
printmask(np->ipn_addr.adf_family,
|
||||||
(u_32_t *)&np->ipn_mask.adf_addr);
|
(u_32_t *)&np->ipn_mask.adf_addr);
|
||||||
} else {
|
} else {
|
||||||
#ifdef AF_INET6
|
#ifdef USE_INET6
|
||||||
if (np->ipn_addr.adf_family == AF_INET6) {
|
if (np->ipn_addr.adf_family == AF_INET6) {
|
||||||
char buf[INET6_ADDRSTRLEN + 1];
|
char buf[INET6_ADDRSTRLEN + 1];
|
||||||
const char *str;
|
const char *str;
|
||||||
@ -54,9 +54,7 @@ printpoolnode(np, opts, fields)
|
|||||||
} else {
|
} else {
|
||||||
PRINTF("\tAddress: family: %d\n",
|
PRINTF("\tAddress: family: %d\n",
|
||||||
np->ipn_addr.adf_family);
|
np->ipn_addr.adf_family);
|
||||||
#ifdef AF_INET6
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
printmask(np->ipn_addr.adf_family,
|
printmask(np->ipn_addr.adf_family,
|
||||||
(u_32_t *)&np->ipn_mask.adf_addr);
|
(u_32_t *)&np->ipn_mask.adf_addr);
|
||||||
#ifdef USE_QUAD_T
|
#ifdef USE_QUAD_T
|
||||||
|
@ -2303,7 +2303,7 @@ makepool(list)
|
|||||||
|
|
||||||
for (n = top, a = list; (n != NULL) && (a != NULL); a = a->al_next) {
|
for (n = top, a = list; (n != NULL) && (a != NULL); a = a->al_next) {
|
||||||
if (use_inet6 == 1) {
|
if (use_inet6 == 1) {
|
||||||
#ifdef AF_INET6
|
#ifdef USE_INET6
|
||||||
n->ipn_addr.adf_family = AF_INET6;
|
n->ipn_addr.adf_family = AF_INET6;
|
||||||
n->ipn_addr.adf_addr = a->al_i6addr;
|
n->ipn_addr.adf_addr = a->al_i6addr;
|
||||||
n->ipn_addr.adf_len = offsetof(addrfamily_t,
|
n->ipn_addr.adf_len = offsetof(addrfamily_t,
|
||||||
|
Loading…
Reference in New Issue
Block a user