[PATCH] Add autoconf test for struct sockaddr_storage.ss_family.

Stefan (metze) Metzmacher metze at samba.org
Tue Oct 23 06:20:46 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jerry,

> diff --git a/source/configure.in b/source/configure.in
> index a96e2d9..d9ab2c1 100644
> --- a/source/configure.in
> +++ b/source/configure.in
> @@ -1,4 +1,4 @@
> -dnl Process this file with autoconf to produce a configure script.
> +>dnl Process this file with autoconf to produce a configure script.

why this hunk?

>  dnl We must use autotools 2.53 or above
>  AC_PREREQ(2.53)
> @@ -3048,7 +3048,23 @@ freeaddrinfo(ai);
>  ],
>  samba_cv_HAVE_IPV6=yes,samba_cv_HAVE_IPV6=no)])
>  if test x"$samba_cv_HAVE_IPV6" = x"yes"; then
> -    AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support])
> +   AC_DEFINE(HAVE_IPV6,1,[Whether the system has IPv6 support])
> +
> +   dnl Check for struct sockaddr_storage.ss_family which is 
> +   dnl missing on AIX 5.3
> +   AC_CACHE_CHECK([for sockaddr_storage.ss_familiy support],samba_cv_HAVE_SA_SS_FAMILY,[
> +   AC_TRY_COMPILE([
> +   #include <sys/socket.h>
> +   #include <sys/types.h>
> +   #include <netdb.h>],
> +   [
> +   struct sockaddr_storage sa_store;
> +   sa_store.ss_family = AF_INET6;
> +   ],
> +   samba_cv_HAVE_SA_SS_FAMILY=yes,samba_cv_HAVE_SA_SS_FAMILY=no)])
> +   if test x"$samba_cv_HAVE_SA_SS_FAMILY" = x"yes"; then
> +      AC_DEFINE(HAVE_SA_SS_FAMILY,1,[Whether the system supports struct sockaddr_storage.ss_family])
> +   fi
>  fi
>  
>  ################################################
> diff --git a/source/include/includes.h b/source/include/includes.h
> index 0d51c3d..49e6586 100644
> --- a/source/include/includes.h
> +++ b/source/include/includes.h
> @@ -895,6 +895,10 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
>  #define MAXHOSTNAMELEN 254
>  #endif
>  
> +#ifndef HAVE_SA_SS_FAMILY
> +#define ss_family   __ss_family
> +#endif
> +

> diff --git a/source/include/interfaces.h b/source/include/interfaces.h
> index 66ea151..a884d25 100644
> --- a/source/include/interfaces.h
> +++ b/source/include/interfaces.h
> @@ -5,6 +5,10 @@
>  
>  #define MAX_INTERFACES 128
>  
> +#ifndef HAVE_SA_SS_FAMILY
> +#define ss_family   __ss_family
> +#endif
> +

why 2 location for the #ifndef?

I think it would be better to have this in lib/replace/system/network.h
and the configure check in lib/replace/libreplace.m4.

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHHZK+m70gjA5TCD8RAtZ1AJ0Xo5x2SmFav6u1wCW6hhxBBAlf1wCeOmY6
xTGI6mUzZi6xplSP6td7lYk=
=Lk+O
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list