VirtualBox

Changeset 19748 in vbox


Ignore:
Timestamp:
May 15, 2009 4:07:44 PM (16 years ago)
Author:
vboxsync
Message:

NAT: fix of (#3885)

File:
1 edited

Legend:

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

    r19313 r19748  
    157157        (q) = (uint8_t *)(&be[1]) + (len);                      \
    158158    }while(0)
     159/* appending another value to tag, calculates len of whole block*/
     160#define FILL_BOOTP_APP(head, q, tag, len, pvalue)               \
     161    do {                                                        \
     162        struct bootp_ext *be = (struct bootp_ext *)(head);      \
     163        memcpy(q, (pvalue), (len));                             \
     164        (q) += (len);                                           \
     165        Assert(be->bpe_tag == (tag));                           \
     166        be->bpe_len += (len);                                   \
     167    }while(0)
    159168
    160169    /* extract exact DHCP msg type */
     
    297306        struct dns_domain_entry *dd = NULL;
    298307        int added = 0;
     308        uint8_t *q_dns_header = NULL;
    299309#endif
    300310        uint32_t lease_time = htonl(LEASE_TIME);
     
    313323            uint32_t addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS);
    314324            FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &addr);
    315         }
    316         else
     325            goto skip_dns_servers;
     326        }
    317327# endif
     328
     329
     330        if (!LIST_EMPTY(&pData->dns_list_head))
     331        {
     332            de = LIST_FIRST(&pData->dns_list_head);
     333            q_dns_header = q;
     334            FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr);
     335        }
     336
    318337        LIST_FOREACH(de, &pData->dns_list_head, de_list)
    319338        {
    320             FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &de->de_addr.s_addr);
    321         }
     339            if (LIST_FIRST(&pData->dns_list_head) == de)
     340                continue; /* first value with head we've ingected before */
     341            FILL_BOOTP_APP(q_dns_header, q, RFC1533_DNS, 4, &de->de_addr.s_addr);
     342        }
     343
     344#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     345        skip_dns_servers:
     346#endif
    322347        if (LIST_EMPTY(&pData->dns_domain_list_head))
    323348        {
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