]> granicus.if.org Git - libevent/commitdiff
Clarify even more about various system-specific problems with getaddrinfo
authorNick Mathewson <nickm@torproject.org>
Tue, 17 Nov 2009 18:29:44 +0000 (18:29 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 17 Nov 2009 18:29:44 +0000 (18:29 +0000)
svn:r1542

evutil.c
include/event2/dns.h

index df63f4534407db9837a47841e8d233c04524fdf5..c81120178776ee94a7bc24cddd38573478f8052f 100644 (file)
--- a/evutil.c
+++ b/evutil.c
@@ -856,10 +856,16 @@ evutil_getaddrinfo(const char *nodename, const char *servname,
                /* Enough operating systems handle enough common non-resolve
                 * cases here weirdly enough that we are better off just
                 * overriding them.  For example:
-                * - Some believe that giving a numeric port as a servname is
-                *   totally verboten.  (I think this includes OpenBSD IIUC).
-                *   [XXXX we don't fix this case completely.]
-                * - Windows is eccentric.
+                * - Some older BSDs used to believe that giving a numeric
+                *   port without giving an ai_socktype was verboten.
+                *   (XXX we don't yet handle the general case of this.)
+                *
+                * - Windows doesn't like to infer the protocol from the
+                *   socket type, or fill in socket or protocol types much at
+                *   all.  It also seems to do its own broken implicit
+                *   always-on version of AI_ADDRCONFIG that keeps it from
+                *   ever resolving even a literal IPv6 address when
+                *   ai_addrtype is PF_UNSPEC.
                 */
                {
                        int err, port;
index 233cbf6d3283e57b1e85d315652115eb325e0261..54f9ffd3c950b5f58901d058d7870ff101245519 100644 (file)
@@ -613,8 +613,12 @@ struct evdns_getaddrinfo_request;
  * we pass the evutil_addrinfo structures we found (or NULL on error).  We
  * pass 'arg' as the third argument.
  *
+ * Limitations:
+ *
  * - The AI_V4MAPPED and AI_ALL flags are not currently implemented.
  * - We don't look at the /etc/hosts file.
+ * - For ai_socktype, we only handle SOCKTYPE_STREAM, SOCKTYPE_UDP, and 0.
+ * - For ai_protocol, we only handle IPPROTO_TCP, IPPROTO_UDP, and 0.
  */
 struct evdns_getaddrinfo_request *evdns_getaddrinfo(
     struct evdns_base *dns_base,