since some systems define AF_INET6 but do not include IPv6 support.
/* Define to 1 if your Kerberos is Heimdal. */
#undef HAVE_HEIMDAL
+/* Define to 1 if <netinet/in.h> contains struct in6_addr. */
+#undef HAVE_IN6_ADDR
+
/* Define to 1 if you have the `initgroups' function. */
#undef HAVE_INITGROUPS
fi
+{ echo "$as_me:$LINENO: checking for struct in6_addr" >&5
+echo $ECHO_N "checking for struct in6_addr... $ECHO_C" >&6; }
+if test "${ac_cv_type_struct_in6_addr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <netinet/in.h>
+
+typedef struct in6_addr ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_struct_in6_addr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_struct_in6_addr=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_in6_addr" >&5
+echo "${ECHO_T}$ac_cv_type_struct_in6_addr" >&6; }
+if test $ac_cv_type_struct_in6_addr = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IN6_ADDR 1
+_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IN6_ADDR 1
+_ACEOF
+
+fi
+
{ echo "$as_me:$LINENO: checking for size_t" >&5
echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
if test "${sudo_cv_type_size_t+set}" = set; then
+
+
# include <sys/time.h>
#endif
#include <time.h>])
+AC_CHECK_TYPES([struct in6_addr], [AC_DEFINE(HAVE_IN6_ADDR)], [], [#include <sys/types.h>
+#include <netinet/in.h>])
SUDO_TYPE_SIZE_T
SUDO_TYPE_SSIZE_T
SUDO_TYPE_DEV_T
AH_TEMPLATE(HAVE_GETSPWUID, [Define to 1 if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.])
AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.])
+AH_TEMPLATE(HAVE_IN6_ADDR, [Define to 1 if <netinet/in.h> contains struct in6_addr.])
AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])
AH_TEMPLATE(HAVE_ISSECURE, [Define to 1 if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
AH_TEMPLATE(HAVE_KERB4, [Define to 1 if you use Kerberos IV.])
{
struct ifaddrs *ifa, *ifaddrs;
struct sockaddr_in *sin;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
struct sockaddr_in6 *sin6;
#endif
int i;
switch(ifa->ifa_addr->sa_family) {
case AF_INET:
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
case AF_INET6:
#endif
num_interfaces++;
interfaces[i].family = AF_INET;
i++;
break;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
case AF_INET6:
sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
memcpy(&interfaces[i].addr, &sin6->sin6_addr,
interfaces[i].family = AF_INET6;
i++;
break;
-#endif /* AF_INET6 */
+#endif /* HAVE_IN6_ADDR */
}
}
#ifdef HAVE_FREEIFADDRS
dump_interfaces()
{
int i;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
char addrbuf[INET6_ADDRSTRLEN], maskbuf[INET6_ADDRSTRLEN];
#endif
printf("\t%s / ", inet_ntoa(interfaces[i].addr.ip4));
puts(inet_ntoa(interfaces[i].netmask.ip4));
break;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
case AF_INET6:
inet_ntop(AF_INET6, &interfaces[i].addr.ip6,
addrbuf, sizeof(addrbuf));
maskbuf, sizeof(maskbuf));
printf("\t%s / %s\n", addrbuf, maskbuf);
break;
-#endif /* AF_INET6 */
+#endif /* HAVE_IN6_ADDR */
}
}
}
int family; /* AF_INET or AF_INET6 */
union {
struct in_addr ip4;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
struct in6_addr ip6;
#endif
} addr;
union {
struct in_addr ip4;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
struct in6_addr ip6;
#endif
} netmask;
int i;
struct in_addr addr;
struct interface *ifp;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
struct in6_addr addr6;
int j;
#endif
int family;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
if (inet_pton(AF_INET6, n, &addr6) > 0) {
family = AF_INET6;
} else
== addr.s_addr)
return(TRUE);
break;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
case AF_INET6:
if (memcmp(ifp->addr.ip6.s6_addr, addr6.s6_addr,
sizeof(addr6.s6_addr)) == 0)
int i;
struct in_addr addr, mask;
struct interface *ifp;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
struct in6_addr addr6, mask6;
int j;
#endif
int family;
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
if (inet_pton(AF_INET6, n, &addr6) > 0)
family = AF_INET6;
else
mask.s_addr = htonl(mask.s_addr);
}
}
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
else {
if (inet_pton(AF_INET6, m, &mask6) <= 0) {
j = atoi(m);
}
}
}
-#endif /* AF_INET6 */
+#endif /* HAVE_IN6_ADDR */
for (i = 0; i < num_interfaces; i++) {
ifp = &interfaces[i];
case AF_INET:
if ((ifp->addr.ip4.s_addr & mask.s_addr) == addr.s_addr)
return(TRUE);
-#ifdef AF_INET6
+#ifdef HAVE_IN6_ADDR
case AF_INET6:
for (j = 0; j < sizeof(addr6.s6_addr); j++) {
if ((ifp->addr.ip6.s6_addr[j] & mask6.s6_addr[j]) != addr6.s6_addr[j])
}
if (j == sizeof(addr6.s6_addr))
return(TRUE);
-#endif /* AF_INET6 */
+#endif /* HAVE_IN6_ADDR */
}
}