]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
* fake-addrinfo.h (AI_ADDRCONFIG, AI_V4MAPPED, AI_ALL): If not defined, or when
authorKen Raeburn <raeburn@mit.edu>
Tue, 5 Oct 2004 21:04:04 +0000 (21:04 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 5 Oct 2004 21:04:04 +0000 (21:04 +0000)
completely faking getaddrinfo, define them as zero.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16803 dc483132-0cff-0310-8789-dd5450dbe970

src/include/fake-addrinfo.h

index 2e11fefd1ce6fe302eb54013ae4d21192e29dcb2..cc23a3f7d17056bbdafa16a154e0b077b1d62fdc 100644 (file)
@@ -362,17 +362,18 @@ struct addrinfo {
 #define        AI_CANONNAME    0x02
 #undef AI_NUMERICHOST
 #define        AI_NUMERICHOST  0x04
-/* N.B.: AI_V4MAPPED, AI_ADDRCONFIG, AI_ALL, and AI_DEFAULT are part
-   of the spec for getipnodeby*, and *not* part of the spec for
-   getaddrinfo.  Don't use them!  */
+/* RFC 2553 says these are part of the interface for getipnodebyname,
+   not for getaddrinfo.  RFC 3493 says they're part of the interface
+   for getaddrinfo, and getipnodeby* are deprecated.  Our fake
+   getaddrinfo implementation here does IPv4 only anyways.  */
 #undef AI_V4MAPPED
-#define        AI_V4MAPPED     eeeevil!
+#define        AI_V4MAPPED     0
 #undef AI_ADDRCONFIG
-#define        AI_ADDRCONFIG   eeeevil!
+#define        AI_ADDRCONFIG   0
 #undef AI_ALL
-#define        AI_ALL          eeeevil!
+#define        AI_ALL          0
 #undef AI_DEFAULT
-#define AI_DEFAULT     eeeevil!
+#define        AI_DEFAULT      (AI_V4MAPPED|AI_ADDRCONFIG)
 
 #ifndef NI_MAXHOST
 #define NI_MAXHOST 1025
@@ -561,6 +562,21 @@ int getnameinfo (const struct sockaddr *addr, socklen_t len,
 #ifndef AI_NUMERICHOST
 # define AI_NUMERICHOST 0
 #endif
+/* Partial RFC 2553 implementations may not have AI_ADDRCONFIG and
+   friends, which RFC 3493 says are now part of the getaddrinfo
+   interface, and we'll want to use.  */
+#ifndef AI_ADDRCONFIG
+# define AI_ADDRCONFIG 0
+#endif
+#ifndef AI_V4MAPPED
+# define AI_V4MAPPED 0
+#endif
+#ifndef AI_ALL
+# define AI_ALL 0
+#endif
+#ifndef AI_DEFAULT
+# define AI_DEFAULT (AI_ADDRCONFIG|AI_V4MAPPED)
+#endif
 
 #if defined(HAVE_FAKE_GETADDRINFO) || defined(FAI_CACHE)
 #define NEED_FAKE_GETADDRINFO