VirtualBox

Changeset 59159 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 16, 2015 4:23:53 PM (9 years ago)
Author:
vboxsync
Message:

NAT: Host resolver - handle CNAME queries. When ANY query is received
for a CNAME, respond with just the CNAME, without A records, as per
RFC1034 section 3.6.2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/hostres.c

    r59157 r59159  
    399399
    400400    if (   qtype != Type_A
     401        && qtype != Type_CNAME
    401402        && qtype != Type_ANY)
    402403    {
     
    441442#endif
    442443
     444    /*
     445     * Emit CNAME record if canonical name differs from the qname.
     446     */
    443447    if (   h->h_name != NULL
    444448        && RTStrICmp(h->h_name, name) != 0)
     
    462466            }
    463467        }
     468
     469        /*
     470         * rfc1034#section-3.6.2 - ... a type CNAME or * query should
     471         * return just the CNAME.
     472         */
     473        if (qtype == Type_CNAME || qtype == Type_ANY)
     474            goto out;
     475    }
     476    else if (qtype == Type_CNAME)
     477    {
     478        LogErr(("NAT: hostres: %s is already canonical\n", name));
     479        goto out; /* NB: RCode_NoError without an answer, not RCode_NXDomain */
    464480    }
    465481
    466482    /*
    467      * XXX: TODO: rfc1034#section-3.6.2
    468      *
    469      * If the query is Type_ANY and the name is CNAME, we should only
    470      * return the CNAME, but not the A RRs.
     483     * Emit A records.
    471484     */
    472485    for (i = 0; h->h_addr_list[i] != NULL; ++i)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette