]> Pileus Git - ~andy/fetchmail/blobdiff - checkalias.c
Minor bug fixes for socket.c
[~andy/fetchmail] / checkalias.c
index 353be44d1f3404a75bc4d0f3aefe0497035a2f27..1e1d16339fe033fc082154c494d78f15b830e512 100644 (file)
@@ -129,7 +129,7 @@ int is_host_alias(const char *name, struct query *ctl, struct addrinfo **res)
     namelen = strlen(name);
     for (idl = lead_server->akalist; idl; idl = idl->next)
     {
-       char    *ep;
+       const char      *ep;
 
        /*
         * Test is >= here because str_in_list() should have caught the
@@ -138,7 +138,7 @@ int is_host_alias(const char *name, struct query *ctl, struct addrinfo **res)
         */
        if (strlen(idl->id) >= namelen)
            continue;
-       ep = (char *)name + (namelen - strlen(idl->id));
+       ep = name + (namelen - strlen(idl->id));
        /* a suffix led by . must match */
        if (ep[-1] == '.' && !strcasecmp(ep, idl->id))
            return(TRUE);
@@ -194,6 +194,15 @@ int is_host_alias(const char *name, struct query *ctl, struct addrinfo **res)
        switch (e)
        {
            case EAI_NONAME:    /* specified host is unknown */
+#ifdef EAI_NODATA
+           /* EAI_NODATA was in the older RFC-2553, but that got
+            * obsoleted by RFC-3493 - there, EAI_NODATA is no longer
+            * valid, and modern operating systems no longer issue this
+            * error code. libesmtp/getaddrinfo.?, however, still does.
+            * (This was reported to Brian Stafford 2013-02-03.)
+            */
+           case EAI_NODATA:    /* specified host is unknown */
+#endif
                break;
 
            default: