VirtualBox

Ignore:
Timestamp:
Jul 29, 2009 9:39:25 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50496
Message:

DHCP Server: fix for passing on commandline options with no values (for e.g. --begin-config)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DHCPServerRunner.cpp

    r21404 r21860  
    6464}
    6565
     66DHCPServerRunner::DHCPServerRunner()
     67{
     68    mProcess = NIL_RTPROCESS;
     69    for (unsigned i = 0; i < DHCPCFG_NOTOPT_MAXVAL; i++)
     70    {
     71        mOptionEnabled[i] = false;
     72    }
     73}
     74
    6675void DHCPServerRunner::detachFromServer()
    6776{
     
    97106    for (unsigned i = 0; i < DHCPCFG_NOTOPT_MAXVAL; i++)
    98107    {
    99         if (mOptions[i].length())
     108        if (mOptionEnabled[i])
    100109        {
    101110            const ARGDEF * pArgDef = getArgDef((DHCPCFG)i);
    102111            args[index++] = pArgDef->Name;      // e.g. "--network"
    103             args[index++] = mOptions[i].raw();  // value
     112
     113            /* value can be null for e.g. --begin-config has no value
     114             * and thus check the mOptions string length here
     115             */
     116            if (mOptions[i].length())
     117                args[index++] = mOptions[i].raw();  // value
    104118        }
    105119    }
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