VirtualBox

Changeset 9144 in vbox for trunk/src


Ignore:
Timestamp:
May 27, 2008 8:34:23 AM (17 years ago)
Author:
vboxsync
Message:

NAT: fixed ARP for .2 and .3 if the guest IP range was changed

File:
1 edited

Legend:

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

    r8285 r9144  
    696696    int ar_op;
    697697    struct ex_list *ex_ptr;
     698    uint32_t htip = ntohl(*(in_addr_t*)ah->ar_tip);
    698699
    699700    ar_op = ntohs(ah->ar_op);
    700701    switch(ar_op) {
    701702    case ARPOP_REQUEST:
    702         if (!memcmp(ah->ar_tip, &special_addr, 3)) {
    703             if (ah->ar_tip[3] == CTL_DNS || ah->ar_tip[3] == CTL_ALIAS)
     703        if ((htip & pData->netmask) == ntohl(special_addr.s_addr)) {
     704            if (   (htip & ~pData->netmask) == CTL_DNS
     705                || (htip & ~pData->netmask) == CTL_ALIAS)
    704706                goto arp_ok;
    705707            for (ex_ptr = exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
    706                 if (ex_ptr->ex_addr == ah->ar_tip[3])
     708                if ((htip & ~pData->netmask) == ex_ptr->ex_addr)
    707709                    goto arp_ok;
    708710            }
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