V4MAPPED address works fine. One caveat is that the log will have IPv6-formatted IP address, e.g. ::ffff:127.0.0.1. If somebody do mind, it is possible to remove "::ffff". -{section: Ulrich Mystery} -Ulrich's Userlevel IPv6 Programming Introductionn - http://people.redhat.com/drepper/userapi-ipv6.html - -He denotes gethostbyaddr() as an obsolete. However, gethostbyaddr() accepts a socket type as a parameter. (AF_INET, AF_INET6) That means it should work well with IPv6. Why it is obsolete?? - -We should continue to use gethostbyaddr() because there is no other way to get DNS aliases using newer socket functions. - -Try getaddrinfo() on www.yahoo.com. You only get 'any-fp.wa1.b.yahoo.com'. -But if you call gethostbyname() on www.yahoo.com, you will get additional hostnames (aliases), which are www.yahoo.com and fp.wg1.b.yahoo.com. - {section: Converting Sock} Sock is not only used by TCP/UDP connection but also used by Unix domain socket (AF_UNIX). Basically, Sock can only create TCP or UDP socket internally but SharedEndPoint and SharedPortClient creates Unix domain socket and calls Sock::assign() to pass the descriptor. @@ -116,6 +106,8 @@ {section: List of Condor IP addr functions} +These are almost done. At some point, should deprecate internet.c and my_hostname.cpp. + {code} // from condor_c++_util/get_full_hostname.cpp @@ -138,15 +130,10 @@ // from condor_util_lib/internet.c // internet.c is a total failure...... tons of old-style codings - int is_ipaddr(const char *inbuf, struct in_addr *sin_addr); - int is_ipaddr_no_wildcard(const char *inbuf, struct in_addr *sin_addr); - int is_ipaddr_wildcard(const char *inbuf, struct in_addr *sin_addr, struct in_addr *mask_addr); - int is_valid_network( const char *network, struct in_addr *ip, struct in_addr *mask); - int is_valid_sinful( const char *sinful ); // there are many more from internet.c. omitted at this time. @@ -173,6 +160,18 @@ In this case, peer_addr() can also fail. +{subsection: Ulrich Mystery} +Ulrich's Userlevel IPv6 Programming Introductionn - http://people.redhat.com/drepper/userapi-ipv6.html + +He denotes gethostbyaddr() as an obsolete. However, gethostbyaddr() accepts a socket type as a parameter. (AF_INET, AF_INET6) That means it should work well with IPv6. Why it is obsolete?? + +We should continue to use gethostbyaddr() because there is no other way to get DNS aliases using newer socket functions. + +Try getaddrinfo() on www.yahoo.com. You only get 'any-fp.wa1.b.yahoo.com'. +But if you call gethostbyname() on www.yahoo.com, you will get additional hostnames (aliases), which are www.yahoo.com and fp.wg1.b.yahoo.com. + + + {subsection: Returning a pointer of a static buffer inside a function} It is quite common practice in Condor source code that returning a pointer of a static buffer in a function. It was perfectly fine in a world that pthread is rare and multi-core is unknown. It is obviously non-re-entrant and non-thread-safe. Well, I could do as it was. But, I am slightly uncomfortable of writing such a function. So, I decided to use MyString instead of returning a pointer of a static buffer.