Ticket #8293: libnetwork.diff

File libnetwork.diff, 2.7 KB (added by donn, 9 years ago)

libnetwork patch

  • headers/posix/resolv.h

    diff --git a/headers/posix/resolv.h b/headers/posix/resolv.h
    index 7ed5767..c73f052 100644
    a b union res_sockaddr_union {  
    238238#define RES_NOTLDQUERY  0x00100000  /* don't unqualified name as a tld */
    239239#define RES_USE_DNSSEC  0x00200000  /* use DNSSEC using OK bit in OPT */
    240240/* #define RES_DEBUG2   0x00400000 */   /* nslookup internal */
     241#define RES_USE_INET4   0x00800000  /* use IPv4 in gethostbyname() */
    241242/* KAME extensions: use higher bit to avoid conflict with ISC use */
    242243#define RES_USE_DNAME   0x10000000  /* use DNAME */
    243244#define RES_USE_EDNS0   0x40000000  /* use EDNS0 if configured */
  • src/kits/network/libbind/irs/getaddrinfo.c

    diff --git a/src/kits/network/libbind/irs/getaddrinfo.c b/src/kits/network/libbind/irs/getaddrinfo.c
    index 1839ba4..b95e6cd 100644
    a b getaddrinfo(hostname, servname, hints, res)  
    328328    struct addrinfo ai, ai0, *afai = NULL;
    329329    struct addrinfo *pai;
    330330    const struct explore *ex;
     331    struct net_data *net_data;
    331332
    332333    memset(&sentinel, 0, sizeof(sentinel));
    333334    cur = &sentinel;
    getaddrinfo(hostname, servname, hints, res)  
    501502    if (hostname == NULL)
    502503        SETERROR(EAI_NONAME);
    503504
     505    /* init after numeric lookups to avoid recursion in resolv.conf */
     506    net_data = init();
     507    if ((net_data->res->options & RES_USE_INET4) && ai0.ai_family == PF_UNSPEC)
     508        ai0.ai_family = PF_INET;
     509
    504510    /*
    505511     * hostname as alphabetical name.
    506512     * We'll make sure that
  • src/kits/network/libbind/resolv/res_debug.c

    diff --git a/src/kits/network/libbind/resolv/res_debug.c b/src/kits/network/libbind/resolv/res_debug.c
    index 8446bbb..3e1d2c6 100644
    a b p_option(u_long option) {  
    680680    case RES_INSECURE2: return "insecure2";
    681681    case RES_NOALIASES: return "noaliases";
    682682    case RES_USE_INET6: return "inet6";
     683    case RES_USE_INET4: return "inet4";
    683684#ifdef RES_USE_EDNS0    /*%< KAME extension */
    684685    case RES_USE_EDNS0: return "edns0";
    685686    case RES_NSID:      return "nsid";
  • src/kits/network/libbind/resolv/res_init.c

    diff --git a/src/kits/network/libbind/resolv/res_init.c b/src/kits/network/libbind/resolv/res_init.c
    index b96d851..213e8d9 100644
    a b res_setoptions(res_state statp, const char *options, const char *source)  
    594594            statp->options |= RES_NOTLDQUERY;
    595595        } else if (!strncmp(cp, "inet6", sizeof("inet6") - 1)) {
    596596            statp->options |= RES_USE_INET6;
     597        } else if (!strncmp(cp, "inet4", sizeof("inet4") - 1)) {
     598            statp->options |= RES_USE_INET4;
    597599        } else if (!strncmp(cp, "rotate", sizeof("rotate") - 1)) {
    598600            statp->options |= RES_ROTATE;
    599601        } else if (!strncmp(cp, "no-check-names",