儲存庫 vbox 的更動 12319
- 時間撮記:
- 2008-9-9 下午06:53:55 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r12279 r12319 955 955 { 956 956 /* 957 * If we are not yet in raw mode; just pass through. 958 */ 959 if (!pStream->fRawMode) 960 break; 961 962 /* 957 963 * Queue up other primitives to the service routine. 958 964 */ … … 995 1001 if (pThis->fActive) 996 1002 { 1003 fSendDownstream = false; 1004 1005 /* 1006 * Some sanity checks. 1007 */ 1008 if ( !pMsg->b_cont 1009 || (MBLKL(pMsg->b_cont) < sizeof(dl_unitdata_req_t) + VBOXNETFLT_DLADDRL) 1010 || (*((uint32_t *)pMsg->b_cont->b_rptr) != DL_UNITDATA_REQ)) 1011 { 1012 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Invalid fast path request!\n")); 1013 miocnak(pQueue, pMsg, 0, EPROTO); 1014 break; 1015 } 1016 1017 dl_unitdata_req_t *pDlReq = (dl_unitdata_req_t *)pMsg->b_cont->b_rptr; 1018 size_t cbOffset = pDlReq->dl_dest_addr_offset; 1019 size_t cbAddr = pDlReq->dl_dest_addr_length; 1020 if ( !MBLKIN(pMsg->b_cont, cbOffset, cbAddr) 1021 || cbAddr != VBOXNETFLT_DLADDRL) 1022 { 1023 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Invalid header in fast path request!\n")); 1024 miocnak(pQueue, pMsg, 0, EPROTO); 1025 break; 1026 } 1027 1028 vboxnetflt_dladdr_t *pDLSapAddr = (vboxnetflt_dladdr_t *)(pMsg->b_cont->b_rptr + cbOffset); 1029 mblk_t *pReplyMsg = allocb(sizeof(RTNETETHERHDR), BPRI_MED); 1030 if (RT_UNLIKELY(!pReplyMsg)) 1031 { 1032 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Invalid header in fast path request!\n")); 1033 miocnak(pQueue, pMsg, 0, ENOMEM); 1034 break; 1035 } 1036 1037 PRTNETETHERHDR pEthHdr = (PRTNETETHERHDR)pMsg->b_rptr; 1038 bcopy(&pDLSapAddr->Mac, &pEthHdr->DstMac, sizeof(RTMAC)); 1039 bcopy(&pThis->u.s.Mac, &pEthHdr->SrcMac, sizeof(RTMAC)); 1040 pEthHdr->EtherType = RT_H2BE_U16(pDLSapAddr->SAP); 1041 1042 linkb(pMsg, pReplyMsg); 1043 997 1044 /* 998 1045 * Somebody is wanting fast path when we need raw mode. 999 1046 * Since we are evil, let's acknowledge the request ourselves! 1000 1047 */ 1001 miocack(pQueue, pMsg, 0, EINVAL);1002 fSendDownstream = false;1003 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Fast path request when we need raw mode!\n"));1048 miocack(pQueue, pMsg, msgsize(pMsg->b_cont), EINVAL); 1049 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: Fast path request acknowledged.\n")); 1050 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModWritePut: ============================================\n")); 1004 1051 } 1005 1052 } … … 1660 1707 if (RT_SUCCESS(rc)) 1661 1708 { 1709 bool fRawModeOk = true; 1710 #if 0 1662 1711 bool fRawModeOk = !fAttach; /* Raw mode check is always ok during the detach case */ 1663 1712 if (fAttach) … … 1677 1726 } 1678 1727 } 1728 #endif 1679 1729 1680 1730 if (fRawModeOk) … … 2083 2133 2084 2134 /* 2135 * Due to the asynchronous nature of streams we may get messages before the 2136 * raw mode is turned on, in this case just pass through. 2137 */ 2138 if (!pStream->fRawMode) 2139 { 2140 LogFlow((DEVICE_NAME ":IP stream not yet in raw mode. Passing through packet.\n")); 2141 putnext(pQueue, pOrigMsg); 2142 return VINF_SUCCESS; 2143 } 2144 2145 /* 2085 2146 * Make a copy as we will alter pMsg. 2086 2147 */ … … 2158 2219 * as upstream consumers expect this format. 2159 2220 */ 2160 if (pStream->fRawMode) 2161 { 2162 if (fSrc & INTNETTRUNKDIR_HOST) 2221 if (fSrc & INTNETTRUNKDIR_HOST) 2222 { 2223 /* Raw packets with correct checksums, pass-through the original */ 2224 if ( fOriginalIsRaw 2225 && !fChecksumAdjusted) 2163 2226 { 2164 /* Raw packets with correct checksums, pass-through the original */2165 if ( fOriginalIsRaw2166 && !fChecksumAdjusted)2167 {2168 putnext(pQueue, pOrigMsg);2169 }2170 else /* For M_PROTO packets or checksum corrected raw packets, pass-through the raw */2171 {2172 putnext(pQueue, pMsg);2173 pMsg = pOrigMsg; /* for the freemsg that follows */2174 }2175 }2176 else /* INTNETTRUNKDIR_WIRE */2177 {2178 if (fOriginalIsRaw)2179 pOrigMsg->b_rptr += sizeof(RTNETETHERHDR);2180 2181 2227 putnext(pQueue, pOrigMsg); 2182 2228 } 2183 } 2184 else 2229 else /* For M_PROTO packets or checksum corrected raw packets, pass-through the raw */ 2230 { 2231 putnext(pQueue, pMsg); 2232 pMsg = pOrigMsg; /* for the freemsg that follows */ 2233 } 2234 } 2235 else /* INTNETTRUNKDIR_WIRE */ 2236 { 2237 if (fOriginalIsRaw) 2238 pOrigMsg->b_rptr += sizeof(RTNETETHERHDR); 2239 2185 2240 putnext(pQueue, pOrigMsg); 2241 } 2186 2242 2187 2243 freemsg(pMsg);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器