RE: ipv6 status

From: Rafael Martinez Torres <rafael.martinez@dont-contact.us>
Date: Thu, 20 Oct 2005 15:56:22 +0200

>Despite: if its a v6-only server, do you mean it serves only ipv6 users but
>is it capable to fetch documents (http ftp) in both ipv6 and ipv4?

Unfortunately, no. Actually it can fetch only ipv6 URL's..

The RFC2133 says: to make gethostbyname2(,) to get ALSO IPv4 mapped
addresses, you should write:

             #include <resolv.h>
           res_init();
           _res.options |= RES_USE_INET6;

       and then gethostbyname2(). This
       option then affects only the process that is calling the
       resolver.

Theorically, the next code at main.cc should solve that: (PLEASE, NOTE THAT
RFC2133 is very deprecated (1997) but could be serve a effective patch....)

#ifdef INET6
#include <resolv.h>
    res_init();
    _res.options |= RES_USE_INET6;
    memset(&local_addr, '\0', sizeof(struct IN_ADDR));
    safe_inet6_addr(localhost, &local_addr);
    memset(&any_addr, '\0', sizeof(struct IN_ADDR));
    safe_inet6_addr("::", &any_addr);
    memset(&no_addr, '\0', sizeof(struct IN_ADDR));
    memset(&no_addr, '\xFF', sizeof(no_addr));
#else
    memset(&local_addr, '\0', sizeof(struct IN_ADDR));
    safe_inet_addr(localhost, &local_addr);
    memset(&any_addr, '\0', sizeof(struct IN_ADDR));
    safe_inet_addr("0.0.0.0", &any_addr);
    memset(&no_addr, '\0', sizeof(struct IN_ADDR));
    safe_inet_addr("255.255.255.255", &no_addr);
#endif

But g++ does not like the content of <resolv.h>, I guess, and compilation
crashes. Maybe I have to express somewhat like extern "C" ?

Does any one know ? (Sorry, at this moment I don't have my developer's box
at hand to reproduce exactly the mistake).

>In one of my scenarios, we have an ipv6 wifi zone. We would like users to
>access the ipv4 via the proxy. Would that fit?

A very interesting scenario, but the answer is no... A possible transient
way is to set both IPv6 and IPv4 servers running as separate processes
independently in TRANSPARENT MODE... You know, making an eventual firewall
to dispatch traphic IPv4 on port 80 to ,i.e., port 3086, and traphic IPv6 on
port 80 to port 3086
Received on Thu Oct 20 2005 - 07:56:26 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Nov 01 2005 - 12:00:07 MST