VirtualBox

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


Ignore:
Timestamp:
Dec 14, 2009 1:16:35 PM (15 years ago)
Author:
vboxsync
Message:

NAT: apply patch from xtracker 5434: update/create ARP cache entry on DHCPACK + re-activate port forwarding on link-up

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

Legend:

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

    r25276 r25362  
    324324        FILL_BOOTP_EXT(q, RFC1533_HOSTNAME, val, slirp_hostname);
    325325    }
     326    slirp_arp_cache_update_or_add(pData, rbp->bp_yiaddr.s_addr, bc->macaddr);
    326327    return q - rbp->bp_vend; /*return offset */
    327328}
     
    457458               memcpy(bc->macaddr, bp->bp_hwaddr, bp->bp_hlen);
    458459               bc->addr.s_addr = bp->bp_ciaddr.s_addr;
    459                slirp_arp_cache_update(pData, bp->bp_ciaddr.s_addr, bp->bp_hwaddr);
    460460            }
    461461            break;
     
    481481            memcpy(bc->macaddr, bp->bp_hwaddr, bp->bp_hlen);
    482482            bc->addr.s_addr = ui32;
    483             slirp_arp_cache_update(pData, bp->bp_ciaddr.s_addr, bp->bp_hwaddr);
    484483            break;
    485484
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r25277 r25362  
    653653void slirp_link_up(PNATState pData)
    654654{
     655    struct arp_cache_entry *ac = NULL;
    655656    link_up = 1;
     657
     658    if (LIST_EMPTY(&pData->arp_cache))
     659        return;
     660
     661    LIST_FOREACH(ac, &pData->arp_cache, list)
     662    {
     663        activate_port_forwarding(pData, ac->ether);
     664    }
    656665}
    657666
     
    21232132}
    21242133
     2134int slirp_arp_cache_update_or_add(PNATState pData, uint32_t dst, const uint8_t *mac)
     2135{
     2136    if (slirp_arp_cache_update(pData, dst, mac))
     2137        slirp_arp_cache_add(pData, dst, mac);
     2138
     2139    return 0;
     2140}
     2141
    21252142/* updates the arp cache
    21262143 * @returns 0 - if has found and updated
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r23462 r25362  
    319319int slirp_arp_cache_update(PNATState pData, uint32_t dst, const uint8_t *mac);
    320320void slirp_arp_cache_add(PNATState pData, uint32_t ip, const uint8_t *ether);
     321int slirp_arp_cache_update_or_add(PNATState pData, uint32_t dst, const uint8_t *mac);
    321322#define MIN_MRU 128
    322323#define MAX_MRU 16384
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