summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/configure.in37
-rw-r--r--source3/lib/interface.c4
-rw-r--r--source3/lib/interfaces.c4
-rw-r--r--source3/lib/util_sock.c16
-rw-r--r--source3/smbd/utmp.c2
5 files changed, 32 insertions, 31 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 22989dbe53..a96e2d91f6 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2962,23 +2962,6 @@ fi
##################
# look for a method of finding the list of network interfaces
iface=no;
-AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
-AC_TRY_RUN([
-#define NO_CONFIG_H 1
-#define HAVE_IFACE_AIX 1
-#define AUTOCONF_TEST 1
-#undef _XOPEN_SOURCE_EXTENDED
-#include "${srcdir-.}/lib/replace/replace.c"
-#include "${srcdir-.}/lib/interfaces.c"],
- samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
-CPPFLAGS="$SAVE_CPPFLAGS"
-if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
- iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
-fi
-
-if test $iface = no; then
AC_CACHE_CHECK([for iface getifaddrs],samba_cv_HAVE_IFACE_GETIFADDRS,[
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
@@ -2993,7 +2976,6 @@ CPPFLAGS="$SAVE_CPPFLAGS"
if test x"$samba_cv_HAVE_IFACE_GETIFADDRS" = x"yes"; then
iface=yes;AC_DEFINE(HAVE_IFACE_GETIFADDRS,1,[Whether iface getifaddrs is available])
fi
-fi
if test $iface = no; then
AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
@@ -3029,6 +3011,24 @@ if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
fi
fi
+if test $iface = no; then
+AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS}"
+AC_TRY_RUN([
+#define NO_CONFIG_H 1
+#define HAVE_IFACE_AIX 1
+#define AUTOCONF_TEST 1
+#undef _XOPEN_SOURCE_EXTENDED
+#include "${srcdir-.}/lib/replace/replace.c"
+#include "${srcdir-.}/lib/interfaces.c"],
+ samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
+CPPFLAGS="$SAVE_CPPFLAGS"
+if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
+ iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
+fi
+fi
+
dnl test for ipv6
AC_CACHE_CHECK([for ipv6 support],samba_cv_HAVE_IPV6,[
AC_TRY_COMPILE([
@@ -3038,6 +3038,7 @@ AC_TRY_COMPILE([
[
struct sockaddr_storage sa_store;
struct addrinfo *ai = NULL;
+struct in6_addr in6addr;
int s = socket(AF_INET6, SOCK_STREAM, 0);
int ret = getaddrinfo(NULL, NULL, NULL, &ai);
if (ret != 0) {
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 4892ec1248..0696329fd6 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -339,7 +339,7 @@ bool make_netmask(struct sockaddr_storage *pss_out,
{
*pss_out = *pss_in;
/* Now apply masklen bits of mask. */
-#if defined(AF_INET6)
+#if defined(HAVE_IPV6)
if (pss_in->ss_family == AF_INET6) {
char *p = (char *)&((struct sockaddr_in6 *)pss_out)->sin6_addr;
unsigned int i;
@@ -386,7 +386,7 @@ static void make_bcast_or_net(struct sockaddr_storage *pss_out,
*pss_out = *pss_in;
/* Set all zero netmask bits to 1. */
-#if defined(AF_INET6)
+#if defined(HAVE_IPV6)
if (pss_in->ss_family == AF_INET6) {
p = (char *)&((struct sockaddr_in6 *)pss_out)->sin6_addr;
pmask = (char *)&((struct sockaddr_in6 *)nmask)->sin6_addr;
diff --git a/source3/lib/interfaces.c b/source3/lib/interfaces.c
index 2b93a5ba39..3b15e3e87b 100644
--- a/source3/lib/interfaces.c
+++ b/source3/lib/interfaces.c
@@ -128,7 +128,7 @@ static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces)
continue;
}
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
if (ifptr->ifa_addr->sa_family == AF_INET6) {
copy_size = sizeof(struct sockaddr_in6);
}
@@ -496,7 +496,7 @@ static int iface_comp(struct iface_struct *i1, struct iface_struct *i2)
{
int r;
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
/*
* If we have IPv6 - sort these interfaces lower
* than any IPv4 ones.
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index eb3b35339c..c6b1311cf5 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -52,7 +52,7 @@ bool is_ipaddress(const char *str)
{
int ret = -1;
-#if defined(AF_INET6)
+#if defined(HAVE_IPV6)
struct in6_addr dest6;
ret = inet_pton(AF_INET6, str, &dest6);
@@ -212,7 +212,7 @@ bool is_loopback_ip_v4(struct in_addr ip)
bool is_loopback_addr(const struct sockaddr_storage *pss)
{
-#if defined(AF_INET6)
+#if defined(HAVE_IPV6)
if (pss->ss_family == AF_INET) {
struct in6_addr *pin6 =
&((struct sockaddr_in6 *)pss)->sin6_addr;
@@ -243,7 +243,7 @@ bool is_zero_ip_v4(struct in_addr ip)
bool is_zero_addr(const struct sockaddr_storage *pss)
{
-#if defined(AF_INET6)
+#if defined(HAVE_IPV6)
if (pss->ss_family == AF_INET) {
struct in6_addr *pin6 =
&((struct sockaddr_in6 *)pss)->sin6_addr;
@@ -302,7 +302,7 @@ void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
sa->sin_addr = ip;
}
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
/*******************************************************************
Convert an IPv6 struct in_addr to a struct sockaddr_storage.
********************************************************************/
@@ -330,7 +330,7 @@ bool same_net(const struct sockaddr_storage *ip1,
return false;
}
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
if (ip1->ss_family == AF_INET6) {
struct sockaddr_in6 ip1_6 = *(struct sockaddr_in6 *)ip1;
struct sockaddr_in6 ip2_6 = *(struct sockaddr_in6 *)ip2;
@@ -370,7 +370,7 @@ bool addr_equal(const struct sockaddr_storage *ip1,
return false;
}
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
if (ip1->ss_family == AF_INET6) {
return (memcmp(&((const struct sockaddr_in6 *)ip1)->sin6_addr,
&((const struct sockaddr_in6 *)ip2)->sin6_addr,
@@ -392,7 +392,7 @@ bool addr_equal(const struct sockaddr_storage *ip1,
bool is_address_any(const struct sockaddr_storage *psa)
{
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
if (psa->ss_family == AF_INET6) {
struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)psa;
if (memcmp(&in6addr_any,
@@ -494,7 +494,7 @@ static int get_socket_port(int fd)
return -1;
}
-#ifdef AF_INET6
+#if defined(HAVE_IPV6)
if (sa.ss_family == AF_INET6) {
return ntohs(((struct sockaddr_in6 *)&sa)->sin6_port);
}
diff --git a/source3/smbd/utmp.c b/source3/smbd/utmp.c
index e36e2aa042..c2908e33cc 100644
--- a/source3/smbd/utmp.c
+++ b/source3/smbd/utmp.c
@@ -525,7 +525,7 @@ static bool sys_utmp_fill(struct utmp *u,
#if defined(HAVE_UT_UT_HOST)
utmp_strcpy(u->ut_host, hostname, sizeof(u->ut_host));
#endif
-#if defined(AF_INET6) && defined(HAVE_UT_UT_ADDR_V6)
+#if defined(HAVE_IPV6) && defined(HAVE_UT_UT_ADDR_V6)
memset(&u->ut_addr_v6, '\0', sizeof(u->ut_addr_v6));
if (ip_addr_str) {
struct in6_addr addr;