VirtualBox

Changeset 65760 in vbox


Ignore:
Timestamp:
Feb 13, 2017 11:32:20 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
113475
Message:

FE/Qt: Global properties: Network page: Host-only Networks tab: Don't save DHCP server attributes if it's disabled, they can be empty or wrong but that's not our business.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp

    r65687 r65760  
    11681168    /* Save DHCP server configuration: */
    11691169    dhcp.SetEnabled(data.m_dhcpserver.m_fDhcpServerEnabled);
    1170     AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerAddress.toUtf8().constData()),
    1171               ("DHCP server IPv4 address must be IPv4-valid!\n"));
    1172     AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerMask.toUtf8().constData()),
    1173               ("DHCP server IPv4 network mask must be IPv4-valid!\n"));
    1174     AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpLowerAddress.toUtf8().constData()),
    1175               ("DHCP server IPv4 lower bound must be IPv4-valid!\n"));
    1176     AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpUpperAddress.toUtf8().constData()),
    1177               ("DHCP server IPv4 upper bound must be IPv4-valid!\n"));
    1178     if (RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerAddress.toUtf8().constData()) &&
    1179         RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerMask.toUtf8().constData()) &&
    1180         RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpLowerAddress.toUtf8().constData()) &&
    1181         RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpUpperAddress.toUtf8().constData()))
    1182     {
    1183         dhcp.SetConfiguration(data.m_dhcpserver.m_strDhcpServerAddress, data.m_dhcpserver.m_strDhcpServerMask,
    1184                               data.m_dhcpserver.m_strDhcpLowerAddress, data.m_dhcpserver.m_strDhcpUpperAddress);
    1185         if (!dhcp.isOk())
    1186             emit sigOperationProgressError(UIMessageCenter::formatErrorInfo(dhcp));
    1187     }
     1170    if (data.m_dhcpserver.m_fDhcpServerEnabled)
     1171    {
     1172        AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerAddress.toUtf8().constData()),
     1173                  ("DHCP server IPv4 address must be IPv4-valid!\n"));
     1174        AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerMask.toUtf8().constData()),
     1175                  ("DHCP server IPv4 network mask must be IPv4-valid!\n"));
     1176        AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpLowerAddress.toUtf8().constData()),
     1177                  ("DHCP server IPv4 lower bound must be IPv4-valid!\n"));
     1178        AssertMsg(RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpUpperAddress.toUtf8().constData()),
     1179                  ("DHCP server IPv4 upper bound must be IPv4-valid!\n"));
     1180        if (RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerAddress.toUtf8().constData()) &&
     1181            RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpServerMask.toUtf8().constData()) &&
     1182            RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpLowerAddress.toUtf8().constData()) &&
     1183            RTNetIsIPv4AddrStr(data.m_dhcpserver.m_strDhcpUpperAddress.toUtf8().constData()))
     1184            dhcp.SetConfiguration(data.m_dhcpserver.m_strDhcpServerAddress, data.m_dhcpserver.m_strDhcpServerMask,
     1185                                  data.m_dhcpserver.m_strDhcpLowerAddress, data.m_dhcpserver.m_strDhcpUpperAddress);
     1186    }
     1187    if (!dhcp.isOk())
     1188        emit sigOperationProgressError(UIMessageCenter::formatErrorInfo(dhcp));
    11881189}
    11891190
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