VirtualBox

Ignore:
Timestamp:
Mar 26, 2009 11:11:10 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: 2869: Rework network adapter UI - strict of entering 0.0.0.0 (broadcast) address/mask for the host-only interface and dhcp server fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGLSettingsNetwork.cpp

    r18261 r18303  
    123123    {
    124124        if (!mInterfaceAddress.isEmpty() &&
    125             QHostAddress (mInterfaceAddress).protocol() != QAbstractSocket::IPv4Protocol)
     125            (QHostAddress (mInterfaceAddress) == QHostAddress::Any ||
     126             QHostAddress (mInterfaceAddress).protocol() != QAbstractSocket::IPv4Protocol))
    126127        {
    127128            aWarning = QTreeWidget::tr ("host IPv4 address of <b>%1</b> is wrong").arg (text (0));
     
    129130        }
    130131        if (!mInterfaceMask.isEmpty() &&
    131             QHostAddress (mInterfaceMask).protocol() != QAbstractSocket::IPv4Protocol)
     132            (QHostAddress (mInterfaceMask) == QHostAddress::Any ||
     133             QHostAddress (mInterfaceMask).protocol() != QAbstractSocket::IPv4Protocol))
    132134        {
    133135            aWarning = QTreeWidget::tr ("host IPv4 network mask of <b>%1</b> is wrong").arg (text (0));
     
    136138        if (mIpv6Supported)
    137139        {
    138 
    139            if (!mInterfaceAddress6.isEmpty() &&
    140                 QHostAddress (mInterfaceAddress6).protocol() != QAbstractSocket::IPv6Protocol)
     140            if (!mInterfaceAddress6.isEmpty() &&
     141                (QHostAddress (mInterfaceAddress6) == QHostAddress::AnyIPv6 ||
     142                 QHostAddress (mInterfaceAddress6).protocol() != QAbstractSocket::IPv6Protocol))
    141143            {
    142144                aWarning = QTreeWidget::tr ("host IPv6 address of <b>%1</b> is wrong").arg (text (0));
     
    149151    if (mDhcpServerEnabled)
    150152    {
    151         if (QHostAddress (mDhcpServerAddress).protocol() != QAbstractSocket::IPv4Protocol)
     153        if (QHostAddress (mDhcpServerAddress) == QHostAddress::Any ||
     154            QHostAddress (mDhcpServerAddress).protocol() != QAbstractSocket::IPv4Protocol)
    152155        {
    153156            aWarning = QTreeWidget::tr ("DHCP server address of <b>%1</b> is wrong").arg (text (0));
    154157            return false;
    155158        }
    156         if (QHostAddress (mDhcpServerMask).protocol() != QAbstractSocket::IPv4Protocol)
     159        if (QHostAddress (mDhcpServerMask) == QHostAddress::Any ||
     160            QHostAddress (mDhcpServerMask).protocol() != QAbstractSocket::IPv4Protocol)
    157161        {
    158162            aWarning = QTreeWidget::tr ("DHCP server mask of <b>%1</b> is wrong").arg (text (0));
    159163            return false;
    160164        }
    161         if (QHostAddress (mDhcpLowerAddress).protocol() != QAbstractSocket::IPv4Protocol)
     165        if (QHostAddress (mDhcpLowerAddress) == QHostAddress::Any ||
     166            QHostAddress (mDhcpLowerAddress).protocol() != QAbstractSocket::IPv4Protocol)
    162167        {
    163168            aWarning = QTreeWidget::tr ("DHCP lower address bound of <b>%1</b> is wrong").arg (text (0));
    164169            return false;
    165170        }
    166         if (QHostAddress (mDhcpUpperAddress).protocol() != QAbstractSocket::IPv4Protocol)
     171        if (QHostAddress (mDhcpUpperAddress) == QHostAddress::Any ||
     172            QHostAddress (mDhcpUpperAddress).protocol() != QAbstractSocket::IPv4Protocol)
    167173        {
    168174            aWarning = QTreeWidget::tr ("DHCP upper address bound of <b>%1</b> is wrong").arg (text (0));
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