]> andersk Git - openssh.git/commitdiff
- (djm) [openbsd-compat/fake-rfc2553.c openbsd-compat/fake-rfc2553.h]
authordjm <djm>
Mon, 14 Jul 2008 11:37:36 +0000 (11:37 +0000)
committerdjm <djm>
Mon, 14 Jul 2008 11:37:36 +0000 (11:37 +0000)
   return EAI_FAMILY when trying to lookup unsupported address family;
   from vinschen AT redhat.com

ChangeLog
openbsd-compat/fake-rfc2553.c
openbsd-compat/fake-rfc2553.h

index c969da6bc52d140a5ce50e8757314edd217acff4..38634f33429c18b3fc13631ba5b51cd462011ea1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,9 @@
      [scp.1]
      better description for -i flag:
      s/RSA authentication/public key authentication/
+ - (djm) [openbsd-compat/fake-rfc2553.c openbsd-compat/fake-rfc2553.h]
+   return EAI_FAMILY when trying to lookup unsupported address family;
+   from vinschen AT redhat.com
 
 20080711
  - (djm) OpenBSD CVS Sync
index b6ea3d21e3425c2a2a070e2ea006e1a562895fff..096d9e092e29a9b7dc6219698d0f1d2a93bcfe82 100644 (file)
@@ -51,6 +51,8 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
        struct hostent *hp;
        char tmpserv[16];
 
+       if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
+               return (EAI_FAMILY);
        if (serv != NULL) {
                snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port));
                if (strlcpy(serv, tmpserv, servlen) >= servlen)
@@ -95,6 +97,8 @@ gai_strerror(int err)
                return ("memory allocation failure.");
        case EAI_NONAME:
                return ("nodename nor servname provided, or not known");
+       case EAI_FAMILY:
+               return ("ai_family not supported");
        default:
                return ("unknown/invalid error.");
        }
@@ -159,6 +163,9 @@ getaddrinfo(const char *hostname, const char *servname,
        u_long addr;
 
        port = 0;
+       if (hints && hints->ai_family != AF_UNSPEC &&
+           hints->ai_family != AF_INET)
+               return (EAI_FAMILY);
        if (servname != NULL) {
                char *cp;
 
index a4ed6705508ecb7893f7ab35036e855b826b3678..376009d4f08e4373746b3dc3de5300baf79c2589 100644 (file)
@@ -129,6 +129,9 @@ struct sockaddr_in6 {
 #ifndef EAI_SYSTEM
 # define EAI_SYSTEM    (INT_MAX - 4)
 #endif
+#ifndef EAI_FAMILY
+# define EAI_FAMILY    (INT_MAX - 5)
+#endif
 
 #ifndef HAVE_STRUCT_ADDRINFO
 struct addrinfo {
This page took 0.525564 seconds and 5 git commands to generate.