Changeset 23136 in vbox for trunk/src/VBox
- Timestamp:
- Sep 18, 2009 2:22:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/darwin/NetIf-darwin.cpp
r23103 r23136 171 171 172 172 pAddresses[i] = sa; 173 173 174 174 ADVANCE(cp, sa); 175 175 } … … 180 180 struct sockaddr *addresses[RTAX_MAX]; 181 181 182 extractAddresses(iAddrMask, cp, cplim, addresses); 182 extractAddresses(iAddrMask, cp, cplim, addresses); 183 183 switch (addresses[RTAX_IFA]->sa_family) 184 184 { … … 213 213 int aiMib[6]; 214 214 struct sockaddr *addresses[RTAX_MAX]; 215 215 216 216 aiMib[0] = CTL_NET; 217 217 aiMib[1] = PF_ROUTE; … … 335 335 336 336 size_t cbNameLen = pSdl->sdl_nlen + 1; 337 Assert(pSdl->sdl_nlen < sizeof(pNIC->szBSDName)); 337 338 for (pNIC = pEtherNICs; pNIC; pNIC = pNIC->pNext) 338 if (!strncmp(pSdl->sdl_data, pNIC->szBSDName, pSdl->sdl_len)) 339 if ( !strncmp(pSdl->sdl_data, pNIC->szBSDName, pSdl->sdl_nlen) 340 && pNIC->szBSDName[pSdl->sdl_nlen] == '\0') 339 341 { 340 342 cbNameLen = strlen(pEtherNICs->szName) + 1; … … 349 351 memcpy(pNew->MACAddress.au8, LLADDR(pSdl), sizeof(pNew->MACAddress.au8)); 350 352 pNew->enmMediumType = NETIF_T_ETHERNET; 351 Assert(sizeof(pNew->szShortName) >= cbNameLen); 352 memcpy(pNew->szShortName, pSdl->sdl_data, pSdl->sdl_nlen); 353 Assert(sizeof(pNew->szShortName) > pSdl->sdl_nlen); 354 memcpy(pNew->szShortName, pSdl->sdl_data, RT_MIN(pSdl->sdl_nlen, sizeof(pNew->szShortName) - 1)); 355 353 356 /* 354 357 * If we found the adapter in the list returned by … … 433 436 char *pBuf, *pNext; 434 437 int aiMib[6]; 435 438 436 439 aiMib[0] = CTL_NET; 437 440 aiMib[1] = PF_ROUTE;
Note:
See TracChangeset
for help on using the changeset viewer.