r19410@cathode-dark-space: raeburn | 2007-04-09 16:58:13 -0400
ticket: new
subject: EAI_NODATA deprecated, not always defined
tags: pullup
target_version: 1.6.1
Brian Kantor reports (on the kerberos@mit list today) that krb5-1.6
doesn't build on FreeBSD 6.1 because they've done away with
EAI_NODATA, which was removed from the getaddrinfo API in RFC 3943.
This patch conditionalizes two tests for EAI_NODATA on the macro being
defined, and also adds handling for EAI_OVERFLOW, a new error code
added in RFC 3943.
ticket: 5518
version_fixed: 1.6.1
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19418
dc483132-0cff-0310-8789-
dd5450dbe970
return EAFNOSUPPORT;
case EAI_MEMORY:
return ENOMEM;
-#if EAI_NODATA != EAI_NONAME
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
case EAI_NODATA:
return KRB5_EAI_NODATA;
#endif
case EAI_NONAME:
return KRB5_EAI_NONAME;
+#if defined(EAI_OVERFLOW)
+ case EAI_OVERFLOW:
+ return EINVAL; /* XXX */
+#endif
case EAI_SERVICE:
return KRB5_EAI_SERVICE;
case EAI_SOCKTYPE:
#ifdef EAI_ADDRFAMILY
case EAI_ADDRFAMILY:
#endif
-#if EAI_NODATA != EAI_NONAME
+#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
case EAI_NODATA:
#endif
case EAI_NONAME:
/* Name not known or no address data, but no error. Do
nothing more. */
return 0;
+#ifdef EAI_OVERFLOW
+ case EAI_OVERFLOW:
+ /* An argument buffer overflowed. */
+ return EINVAL; /* XXX */
+#endif
#ifdef EAI_SYSTEM
case EAI_SYSTEM:
/* System error, obviously. */