Subject: HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID check incorrect?

HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID check incorrect?

From: Bram Matthys (Syzop) <syzop_at_vulnscan.org>
Date: 2006-06-25

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

Someone reported a compile problem on an old Sun Cobalt RAQ3 to me.
The problem is that HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID gets defined, even though
it probably never should.

Relevant config.log output below.

[..]
configure:20271: checking if struct sockaddr_in6 has member sin6_scope_id
configure:20271: gcc -c -g -O2 conftest.c >&5
conftest.c: In function `main':
conftest.c:51: structure has no member named `sin6_scope_id'
configure:20271: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "c-ares"
| #define VERSION "1.3.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_SELECT_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_NET_IF_H 1
| #define HAVE_ARPA_NAMESER_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_PF_INET6 1
| #define HAVE_AF_INET6 1
| #define HAVE_STRUCT_IN6_ADDR 1
| #define HAVE_STRUCT_SOCKADDR_IN6 1
| /* end confdefs.h. */
|
| #ifdef HAVE_SYS_TYPES_H
| #include <sys/types.h>
| #endif
| #ifdef HAVE_WINSOCK_H
| #include <winsock.h>
| #endif
| #ifdef HAVE_NETINET_IN_H
| #include <netinet/in.h>
| #endif
|
| int
| main ()
| {
|
| struct sockaddr_in6 struct_instance;
| struct_instance.sin6_scope_id = 0;
|
| ;
| return 0;
| }
configure:20271: result: yes
configure:20274: checking for struct addrinfo
[..]

In the same config.log I noticed a while later, in the other tests, it indeed
adds a #define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, and it does this in config.h
as well.
The odd thing here is that it's clear the program failed (no member named..),
yet, configure just says "result: yes" and adds the define and such :P

I'm no autoconf guru, so if anyone could fix this, that would be nice.
Probably must be super simple :P

TIA,

        Syzop.

- --
Bram Matthys
Software developer/IT consultant syzop@vulnscan.org
PGP key: www.vulnscan.org/pubkey.asc
PGP fp: 8DD4 437E 9BA8 09AA 0A8D 1811 E1C3 D65F E6ED 2AA2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iD8DBQFEnb+a4cPWX+btKqIRAmdAAJ0YgJmswun7siqULJCtpXP462xLCwCeLQcK
V/wGtSmhAd6kUexyMDHRZBI=
=Kieb
-----END PGP SIGNATURE-----
Received on Sun Jun 25 00:41:50 2006