From: Ken Raeburn Date: Sun, 17 Oct 1999 07:34:05 +0000 (+0000) Subject: If INET6 support is built in but the socket creation fails, fall back to INET X-Git-Tag: krb5-1.2-beta1~210 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e3a442c7e74814977c99c677215f0519ac84b92e;p=krb5.git If INET6 support is built in but the socket creation fails, fall back to INET git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11865 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index fb2461596..118c17afd 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,7 +1,8 @@ 1999-10-17 Ken Raeburn * localaddr.c (krb5_os_localaddr): Raise buffer size to 10K. - Handle INET6 addresses. + Handle INET6 addresses. If INET6 support is built in but the + socket creation fails, fall back to INET. 1999-09-28 Ken Raeburn diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index c4d4986e3..6a9acdc4e 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -55,7 +55,8 @@ #ifndef USE_AF #ifdef AF_INET6 -#define USE_AF AF_INET6 +#define USE_AF AF_INET6 +#define USE_AF2 AF_INET #else #define USE_AF AF_INET #endif @@ -127,8 +128,12 @@ krb5_os_localaddr(context, addr) memset(buf, 0, sizeof(buf)); ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; - + s = socket (USE_AF, USE_TYPE, USE_PROTO); +#if defined (USE_AF2) && defined (EPROTONOSUPPORT) + if (s < 0 && SOCKET_ERRNO == EPROTONOSUPPORT) + s = socket (USE_AF2, USE_TYPE, USE_PROTO); +#endif if (s < 0) return SOCKET_ERRNO;