VirtualBox

Changeset 39773 in vbox for trunk/src


Ignore:
Timestamp:
Jan 17, 2012 2:42:36 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75718
Message:

NAT: logs and comments.

File:
1 edited

Legend:

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

    r39766 r39773  
    3030#define DNS_CONTROL_PORT_NUMBER 53
    3131/* see RFC 1035(4.1.1) */
     32#pragma pack(1)
    3233union dnsmsg_header
    3334{
    3435    struct
    3536    {
    36         unsigned id:16;
     37        uint16_t id;
    3738        unsigned rd:1;
    3839        unsigned tc:1;
     
    4849        uint16_t arcount;
    4950    } X;
    50     uint16_t raw[6];
     51    uint16_t raw[5];
    5152};
     53#pragma pack()
    5254AssertCompileSize(union dnsmsg_header, 12);
    5355
     
    99101{
    100102    int i;
    101 
     103    LogFlowFunc(("ENTER: pszQname:%s\n", pszQname));
     104    pHdr->X.qr = 1; /* response */
    102105    if (!pHostent)
    103106    {
    104         pHdr->X.qr = 1; /* response */
    105107        pHdr->X.aa = 1;
    106108        pHdr->X.rd = 1;
     
    189191        pIp->ip_len = htons(packet_len);
    190192    }
     193    LogFlowFuncLeave();
    191194}
    192195
     
    204207    struct udphdr *udp = NULL;
    205208    union dnsmsg_header *pHdr = NULL;
     209    LogFlowFuncEnter();
    206210    NOREF(la);
    207211    NOREF(ah);
     
    210214
    211215    if (pHdr->X.qr == 1)
     216    {
     217        LogFlowFunc(("pHdr(X.qr:%d, raw:%RX16)\n", pHdr->X.qr, pHdr->raw));
     218        LogFlowFuncLeave();
    212219        return 0; /* this is respose */
     220    }
    213221
    214222    memset(pszCname, 0, sizeof(pszCname));
     
    223231            fMultiWarn = true;
    224232        }
     233        LogFlowFuncLeave();
    225234        return 1;
    226235    }
     
    263272    pIp->ip_sum = 0;
    264273    pIp->ip_sum = LibAliasInternetChecksum(la, (uint16_t *)pIp, pIp->ip_hl << 2);
     274    LogFlowFuncLeave();
    265275    return 0;
    266276}
     
    394404            if (!strcmp(pDNSMapingEntry->pszCName, *pszAlias))
    395405            {
    396 
     406                /*
     407                 * we need add mappings for real host name, instead of using alias.
     408                 * DNS server doesn't return alias list on real name request.
     409                 */
    397410                PDNSMAPPINGENTRY pDnsMapping = RTMemAllocZ(sizeof(DNSMAPPINGENTRY));
    398411                fMatch = true;
Note: See TracChangeset for help on using the changeset viewer.

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