VirtualBox

Changeset 75512 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 16, 2018 11:33:38 AM (6 years ago)
Author:
vboxsync
Message:

Main/DHCPD: bugref:9288 Use new implementation of DHCP server.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp

    r72826 r75512  
    5252    OP_ADD = 1000,
    5353    OP_REMOVE,
    54     OP_MODIFY
     54    OP_MODIFY,
     55    OP_RESTART
    5556} OPCODE;
    5657
     
    319320
    320321    if(   enmCode != OP_REMOVE
     322       && enmCode != OP_RESTART
    321323       && GlobalDhcpOptions.empty()
    322324       && VmSlot2Options.empty())
     
    374376    }
    375377
    376     if(enmCode != OP_REMOVE)
     378    if (enmCode == OP_RESTART)
     379    {
     380        CHECK_ERROR(svr, Restart());
     381        if(FAILED(rc))
     382            return errorArgument("Failed to restart server");
     383    }
     384    else if (enmCode == OP_REMOVE)
     385    {
     386        CHECK_ERROR(a->virtualBox, RemoveDHCPServer(svr));
     387        if(FAILED(rc))
     388            return errorArgument("Failed to remove server");
     389    }
     390    else
    377391    {
    378392        if (pIp || pNetmask || pLowerIp || pUpperIp)
     
    425439        }
    426440    }
    427     else
    428     {
    429         CHECK_ERROR(a->virtualBox, RemoveDHCPServer(svr));
    430         if(FAILED(rc))
    431             return errorArgument("Failed to remove server");
    432     }
    433441
    434442    return RTEXITCODE_SUCCESS;
     
    448456    else if (strcmp(a->argv[0], "remove") == 0)
    449457        rcExit = handleOp(a, OP_REMOVE, 1);
     458    else if (strcmp(a->argv[0], "restart") == 0)
     459        rcExit = handleOp(a, OP_RESTART, 1);
    450460    else
    451461        rcExit = errorSyntax(USAGE_DHCPSERVER, "Invalid parameter '%s'", Utf8Str(a->argv[0]).c_str());
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