VirtualBox

Changeset 19688 in vbox


Ignore:
Timestamp:
May 14, 2009 11:45:54 AM (16 years ago)
Author:
vboxsync
Message:

NAT: fix (#3900) don't create request if no dns server registered in dns proxy

File:
1 edited

Legend:

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

    r19309 r19688  
    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);
     272        if (req->dns_server == NULL)
     273        {
     274            static int fail_counter = 0;
     275            RTMemFree(req);
     276            if (fail_counter == 0)
     277                LogRel(("NAT/dnsproxy: Empty DNS entry (suppressed 100 times)\n"));
     278            else
     279                fail_counter = (fail_counter == 100 ? 0 : fail_counter++);
     280            return;
     281           
     282        }
     283        retransmit = 0;
    271284        so->so_timeout = timeout;
    272285        so->so_timeout_arg = req;
    273         retransmit = 0;
    274         req->dns_server = LIST_FIRST(&pData->dns_list_head);
    275286        req->nbyte = byte;
    276287        memcpy(req->byte, buf, byte); /* copying original request */
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