Changeset 28335 in vbox
- Timestamp:
- Apr 14, 2010 10:02:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r28332 r28335 1941 1941 static int e1kRxChecksumOffload(E1KSTATE* pState, const uint8_t *pFrame, size_t cb, E1KRXDST *pStatus) 1942 1942 { 1943 /** @todo 1944 * It is not safe to bypass checksum verification for packets coming 1945 * from real wire. We currently unable to tell where packets are 1946 * coming from so we tell the driver to ignore our checksum flags 1947 * and do verification in software. 1948 */ 1949 #if 0 1943 1950 uint16_t uEtherType = ntohs(*(uint16_t*)(pFrame + 12)); 1944 PRTNETIPV4 pIpHdr4;1945 1951 1946 1952 E1kLog2(("%s e1kRxChecksumOffload: EtherType=%x\n", INSTANCE(pState), uEtherType)); … … 1948 1954 switch (uEtherType) 1949 1955 { 1950 /** @todo1951 * It is not safe to bypass checksum verification for packets coming1952 * from real wire. We currently unable to tell where packets are1953 * coming from so we tell the driver to ignore our checksum flags1954 * and do verification in software.1955 */1956 #if 01957 1956 case 0x800: /* IPv4 */ 1957 { 1958 1958 pStatus->fIXSM = false; 1959 1959 pStatus->fIPCS = true; 1960 pIpHdr4 = (PRTNETIPV4)(pFrame + 14);1960 PRTNETIPV4 pIpHdr4 = (PRTNETIPV4)(pFrame + 14); 1961 1961 /* TCP/UDP checksum offloading works with TCP and UDP only */ 1962 1962 pStatus->fTCPCS = pIpHdr4->ip_p == 6 || pIpHdr4->ip_p == 17; 1963 1963 break; 1964 } 1964 1965 case 0x86DD: /* IPv6 */ 1965 1966 pStatus->fIXSM = false; … … 1967 1968 pStatus->fTCPCS = true; 1968 1969 break; 1969 #endif1970 1970 default: /* ARP, VLAN, etc. */ 1971 1971 pStatus->fIXSM = true; 1972 1972 break; 1973 1973 } 1974 1974 #else 1975 pStatus->fIXSM = true; 1976 #endif 1975 1977 return VINF_SUCCESS; 1976 1978 } … … 3122 3124 { 3123 3125 PPDMSCATTERGATHER pSg = pState->CTX_SUFF(pTxSg); 3124 uint32_t const cbFrame = pSg ? ( size_t)pSg->cbUsed : 0;3126 uint32_t const cbFrame = pSg ? (uint32_t)pSg->cbUsed : 0; 3125 3127 Assert(!pSg || pSg->cSegs == 1); 3126 3128
Note:
See TracChangeset
for help on using the changeset viewer.