VirtualBox

Changeset 19979 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
May 25, 2009 2:29:12 AM (16 years ago)
Author:
vboxsync
Message:

NAT: fix of vbox.org/4091 change list to queue to feed dhcp client with

rigth order of DNS servers

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
4 edited

Legend:

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

    r19851 r19979  
    331331
    332332
    333         if (!LIST_EMPTY(&pData->dns_list_head))
    334         {
    335             de = LIST_FIRST(&pData->dns_list_head);
     333        if (!TAILQ_EMPTY(&pData->dns_list_head))
     334        {
     335            de = TAILQ_LAST(&pData->dns_list_head, dns_list_head);
    336336            q_dns_header = q;
    337337            FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr);
    338338        }
    339339
    340         LIST_FOREACH(de, &pData->dns_list_head, de_list)
    341         {
    342             if (LIST_FIRST(&pData->dns_list_head) == de)
     340        TAILQ_FOREACH_REVERSE(de, &pData->dns_list_head, dns_list_head, de_list)
     341        {
     342            if (TAILQ_LAST(&pData->dns_list_head, dns_list_head) == de)
    343343                continue; /* first value with head we've ingected before */
    344344            FILL_BOOTP_APP(q_dns_header, q, RFC1533_DNS, 4, &de->de_addr.s_addr);
  • trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c

    r19700 r19979  
    106106    struct request *req = (struct request *)arg;
    107107    struct dns_entry *de;
    108     de = LIST_NEXT(req->dns_server, de_list);
     108    de = TAILQ_PREV(req->dns_server, dns_list_head, de_list);
    109109    /* here we should check if we reached the end of the DNS server list */
    110110    if (de == NULL)
     
    269269        memcpy(&req->client, &fromaddr, sizeof(struct sockaddr_in));
    270270        memcpy(&req->clientid, &buf[0], 2);
    271         req->dns_server = LIST_FIRST(&pData->dns_list_head);
     271        req->dns_server = TAILQ_LAST(&pData->dns_list_head, dns_list_head);
    272272        if (req->dns_server == NULL)
    273273        {
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r19977 r19979  
    377377                da->de_addr.s_addr = ((struct sockaddr_in *)saddr)->sin_addr.s_addr;
    378378            }
    379             LIST_INSERT_HEAD(&pData->dns_list_head, da, de_list);
     379            TAILQ_INSERT_HEAD(&pData->dns_list_head, da, de_list);
    380380
    381381            if (addr->DnsSuffix == NULL)
     
    583583static int slirp_init_dns_list(PNATState pData)
    584584{
    585     LIST_INIT(&pData->dns_list_head);
     585    TAILQ_INIT(&pData->dns_list_head);
    586586    LIST_INIT(&pData->dns_domain_list_head);
    587587    return get_dns_addr_domain(pData, true, NULL, NULL);
     
    592592    struct dns_entry *de = NULL;
    593593    struct dns_domain_entry *dd = NULL;
    594     while(!LIST_EMPTY(&pData->dns_domain_list_head)) {
    595         dd = LIST_FIRST(&pData->dns_domain_list_head);
    596         LIST_REMOVE(dd, dd_list);
    597         if (dd->dd_pszDomain != NULL)
    598             RTStrFree(dd->dd_pszDomain);
    599         RTMemFree(dd);
     594    while(!TAILQ_EMPTY(&pData->dns_list_head)) {
     595        de = TAILQ_FIRST(&pData->dns_list_head);
     596        TAILQ_REMOVE(&pData->dns_list_head, de, de_list);
     597        RTMemFree(de);
    600598    }
    601599    while(!LIST_EMPTY(&pData->dns_domain_list_head)) {
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r19977 r19979  
    7070{
    7171        struct in_addr de_addr;
    72         LIST_ENTRY(dns_entry) de_list;
     72        TAILQ_ENTRY(dns_entry) de_list;
    7373};
    74 LIST_HEAD(dns_list_head, dns_entry);
     74TAILQ_HEAD(dns_list_head, dns_entry);
    7575#endif
    7676
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