Changeset 65580 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Feb 1, 2017 10:36:52 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 113234
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp
r65571 r65580 276 276 return E_INVALIDARG; 277 277 278 /* 279 * Insist on continuous mask. May be also accept prefix length 280 * here or address/prefix for aIPAddress? 281 */ 282 rc = RTNetMaskToPrefixIPv4(&NetworkMask, NULL); 283 if (RT_FAILURE(rc)) 284 return E_INVALIDARG; 285 278 286 /* It's more convenient to convert to host order once */ 279 287 IPAddress.u = RT_N2H_U32(IPAddress.u); … … 288 296 { 289 297 return E_INVALIDARG; 290 }291 292 /*293 * Insist on continuous mask. May be also accept prefix length294 * here or address/prefix for aIPAddress?295 */296 if (NetworkMask.u != 0) {297 /* TODO: factor out mask<->length to <iptr/cidr.h>? */298 uint32_t prefixMask = 0xffffffff;299 int prefixLen = 32;300 301 while (prefixLen > 0) {302 if (NetworkMask.u == prefixMask)303 break;304 --prefixLen;305 prefixMask <<= 1;306 }307 308 if (prefixLen == 0)309 return E_INVALIDARG;310 298 } 311 299
Note:
See TracChangeset
for help on using the changeset viewer.