VirtualBox

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


Ignore:
Timestamp:
Oct 2, 2009 3:22:39 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53127
Message:

NAT: DHCPDECLINE was added.

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

Legend:

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

    r23369 r23496  
    633633        case DHCPRELEASE:
    634634            flag = 1;
    635 #if 0
    636         case DHCPDECLINE:
    637 #endif
    638635            rc = dhcp_decode_release(pData, bp, buf, size, flag);
    639636            if (rc > 0)
    640637                goto reply;
     638        break;
     639        case DHCPDECLINE:
     640            p = dhcp_find_option(&bp->bp_vend[0], RFC2132_REQ_ADDR);
     641            req_ip.s_addr = *(uint32_t *)(p + 2);
     642            rc = bootp_cache_lookup_ether_by_ip(pData, req_ip.s_addr, NULL);
     643            if (rc != 0)
     644            {
     645                /* Not registered */
     646                BOOTPClient *bc;
     647                bc = bc_alloc_client(pData);
     648                Assert(bc);
     649                bc->addr.s_addr = req_ip.s_addr;
     650                slirp_arp_who_has(pData, bc->addr.s_addr);
     651                LogRel(("NAT: %R[IP4] has been already registered\n", &req_ip));
     652            }
     653            /* no response required */
    641654        break;
    642655        default:
     
    729742    int rc = 1;
    730743    int i;
    731     if (ether == NULL)
    732         return rc;
    733744    for (i = 0; i < NB_ADDR; i++)
    734745    {
     
    736747            && ip == bootp_clients[i].addr.s_addr)
    737748        {
    738             memcpy(ether, bootp_clients[i].macaddr, ETH_ALEN);
     749            if(ether != NULL) memcpy(ether, bootp_clients[i].macaddr, ETH_ALEN);
    739750            rc = 0;
    740751            break;
  • trunk/src/VBox/Devices/Network/slirp/bootp.h

    r22664 r23496  
    7171#define DHCPOFFER               2
    7272#define DHCPREQUEST             3
     73#define DHCPDECLINE             4
    7374#define DHCPACK                 5
    7475#define DHCPNAK                 6
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette