VirtualBox

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


Ignore:
Timestamp:
Mar 5, 2014 6:39:57 AM (11 years ago)
Author:
vboxsync
Message:

NAT:bootp.c: dhcp server shouldn't crash if DNS information is empty or not full.

File:
1 edited

Legend:

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

    r50672 r50689  
    303303        FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &addr);
    304304    }
    305     else
    306     {
    307         if (!TAILQ_EMPTY(&pData->pDnsList))
    308         {
    309             de = TAILQ_LAST(&pData->pDnsList, dns_list_head);
    310             q_dns_header = q;
    311             FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr);
    312         }
     305    else if (!TAILQ_EMPTY(&pData->pDnsList))
     306    {
     307        de = TAILQ_LAST(&pData->pDnsList, dns_list_head);
     308        q_dns_header = q;
     309        FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr);
    313310
    314311        TAILQ_FOREACH_REVERSE(de, &pData->pDnsList, dns_list_head, de_list)
     
    319316        }
    320317    }
    321     if (pData->fPassDomain && !pData->fUseHostResolver)
     318
     319    if (   pData->fPassDomain
     320        && !pData->fUseHostResolver
     321        && !LIST_EMPTY(&pData->pDomainList))
    322322    {
    323323        LIST_FOREACH(dd, &pData->pDomainList, dd_list)
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