Changeset 11117 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Aug 4, 2008 5:39:07 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 34053
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r11074 r11117 980 980 * has already checked those. 981 981 */ 982 unsigned cLeft = pCache->cEntries;982 int i = pCache->cEntries - 2; 983 983 uint8_t const *pbEntry = pCache->pbEntries + pCache->cbEntry; 984 while ( --cLeft >1)984 while (i >= 1) 985 985 { 986 986 if (RT_LIKELY(intnetR0AddrUIsEqualEx((PCRTNETADDRU)pbEntry, pAddr, cbAddr))) … … 990 990 } 991 991 pbEntry += pCache->cbEntry; 992 cLeft--;992 i--; 993 993 } 994 994 … … 1014 1014 1015 1015 /* 1016 * The optimized case is when the address the first cache entry.1016 * The optimized case is when the address the first or last cache entry. 1017 1017 */ 1018 1018 unsigned i = pCache->cEntries; 1019 1019 if (RT_LIKELY( i > 0 1020 && intnetR0AddrUIsEqualEx((PCRTNETADDRU)pCache->pbEntries, pAddr, cbAddr))) 1020 && ( intnetR0AddrUIsEqualEx((PCRTNETADDRU)pCache->pbEntries, pAddr, cbAddr) 1021 || (i > 1 1022 && intnetR0AddrUIsEqualEx((PCRTNETADDRU)(pCache->pbEntries + pCache->cbEntry * i), pAddr, cbAddr))) )) 1021 1023 { 1022 1024 /** @todo usage/ageing? */ 1023 1025 return; 1024 1026 } 1025 if (i <= 1)1026 return;1027 1028 /*1029 * And the case where it's the last entry.1030 */1031 i--;1032 if (RT_LIKELY(intnetR0AddrUIsEqualEx((PCRTNETADDRU)pCache->pbEntries, pAddr, cbAddr)))1033 {1034 /** @todo usage/ageing? */1035 return;1036 }1037 if (i <= 1)1038 return;1039 1040 1027 intnetR0IfAddrCacheAddSlow(pIf, pCache, pAddr, cbAddr, pszMsg); 1041 1028 } … … 2250 2237 { 2251 2238 intnetR0SgInitTemp(&Sg, (void *)pvFrame, cbFrame); 2239 if (pNetwork->fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE) 2240 intnetR0IfSnoopAddr(pIf, (uint8_t *)pvFrame, cbFrame, (uint16_t *)&Sg.fFlags); 2252 2241 intnetR0NetworkSend(pNetwork, pIf, 0, &Sg, !!pTrunkIf); 2253 2242 } … … 3472 3461 Assert(pTrunkIF->pIfPort); 3473 3462 pNetwork->pTrunkIF = pTrunkIF; 3474 Log Flow(("intnetR0NetworkCreateTrunkIf: VINF_SUCCESS - pszName=%s szTrunk=%s Network=%s\n",3475 rc, pszName, pNetwork->szTrunk, pNetwork->szName));3463 Log(("intnetR0NetworkCreateTrunkIf: VINF_SUCCESS - pszName=%s szTrunk=%s %s Network=%s%s\n", 3464 pszName, pNetwork->szTrunk, pNetwork->fFlags & INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE ? " shared-mac" : "", pNetwork->szName)); 3476 3465 return VINF_SUCCESS; 3477 3466 }
Note:
See TracChangeset
for help on using the changeset viewer.