VirtualBox

Changeset 91917 in vbox


Ignore:
Timestamp:
Oct 21, 2021 12:34:53 AM (3 years ago)
Author:
vboxsync
Message:

NAT/Net: NATNetwork::setNetwork - be prepared for RTNetStrToIPv4Cidr
to return zero prefix. bugref:9330.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/NATNetworkImpl.cpp

    r91503 r91917  
    293293     * /32 is a single address, not a network, /31 is the degenerate
    294294     * point-to-point case, so reject these.  Larger values and
    295      * non-positive values are already treated as errors by the
     295     * negative values are already treated as errors by the
    296296     * conversion.
    297297     */
     
    299299        return setError(E_FAIL, tr("%s network is too small"), aIPv4NetworkCidr.c_str());
    300300
     301    if (iPrefix == 0)
     302        return setError(E_FAIL, tr("%s specifies zero prefix"), aIPv4NetworkCidr.c_str());
     303
    301304    rc = RTNetPrefixToMaskIPv4(iPrefix, &Mask);
    302305    AssertRCReturn(rc, setError(E_FAIL,
     
    308311            tr("%s: the specified address is longer than the specified prefix"),
    309312            aIPv4NetworkCidr.c_str());
     313
     314    /** @todo r=uwe Check the address is unicast, not a loopback, etc. */
    310315
    311316    /* normalized CIDR notation */
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