- Timestamp:
- Sep 24, 2008 12:12:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r12672 r12683 793 793 vboxnetflt_stream_t **ppPrevStream = NULL; 794 794 795 qprocsoff(pQueue); 796 795 797 /* 796 798 * Get instance data. … … 806 808 PVBOXNETFLTINS pThis = ASMAtomicUoReadPtr((void * volatile *)&pStream->pThis); 807 809 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 808 809 qprocsoff(pQueue);810 810 811 811 /* … … 859 859 * Yes, I'm paranoid. 860 860 */ 861 if (!pMsg || !pQueue)861 if (!pMsg) 862 862 { 863 863 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModReadPut huh?? Invalid parameters.\n")); … … 884 884 { 885 885 /* 886 * Retain the instance if we're actively filtering. 886 * Retain the instance if we're filtering regardless of we are active or not 887 * The reason being even when we are inactive we reference the instance (e.g 888 * the promiscuous OFF acknowledgement case). 887 889 */ 888 890 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; … … 2396 2398 if (!pPromiscStream->pHead) 2397 2399 { 2398 pCur = RTMemAlloc Z(sizeof(VBOXNETFLTPACKETID));2400 pCur = RTMemAlloc(sizeof(VBOXNETFLTPACKETID)); 2399 2401 if (RT_UNLIKELY(!pCur)) 2400 2402 { … … 2407 2409 pPromiscStream->pHead = pCur; 2408 2410 pPromiscStream->pTail = pCur; 2409 pCur->pNext = NULL;2410 2411 pPromiscStream->cLoopback++; 2411 2412 … … 2414 2415 break; 2415 2416 } 2416 2417 if ( pPromiscStream->pTail 2418 && pPromiscStream->pTail->cbPacket == 0) 2417 else if ( pPromiscStream->pTail 2418 && pPromiscStream->pTail->cbPacket == 0) 2419 2419 { 2420 2420 pCur = pPromiscStream->pTail; … … 2426 2426 break; 2427 2427 } 2428 2429 AssertRelease(pPromiscStream->pTail); 2430 2431 pCur = RTMemAllocZ(sizeof(VBOXNETFLTPACKETID)); 2432 if (RT_UNLIKELY(!pCur)) 2428 else 2433 2429 { 2434 rc = VERR_NO_MEMORY; 2430 Assert(pPromiscStream->pTail); 2431 pCur = RTMemAlloc(sizeof(VBOXNETFLTPACKETID)); 2432 if (RT_UNLIKELY(!pCur)) 2433 { 2434 rc = VERR_NO_MEMORY; 2435 break; 2436 } 2437 2438 vboxNetFltSolarisInitPacketId(pCur, pMsg); 2439 2440 pPromiscStream->pTail->pNext = pCur; 2441 pPromiscStream->pTail = pCur; 2442 pPromiscStream->cLoopback++; 2443 2444 LogFlow((DEVICE_NAME ":vboxNetFltSolarisQueueLoopback added tail checksum=%u cLoopback=%d.\n", pCur->Checksum, 2445 pPromiscStream->cLoopback)); 2435 2446 break; 2436 2447 } 2437 2438 vboxNetFltSolarisInitPacketId(pCur, pMsg);2439 pPromiscStream->pTail->pNext = pCur;2440 pPromiscStream->pTail = pCur;2441 pCur->pNext = NULL;2442 pPromiscStream->cLoopback++;2443 2444 LogFlow((DEVICE_NAME ":vboxNetFltSolarisQueueLoopback added tail checksum=%u cLoopback=%d.\n", pCur->Checksum,2445 pPromiscStream->cLoopback));2446 break;2447 2448 } while (0); 2448 2449 } … … 2460 2461 pPromiscStream->pTail = pCur; 2461 2462 2462 pCur->pNext = NULL;2463 2463 vboxNetFltSolarisInitPacketId(pCur, pMsg); 2464 2464 LogFlow((DEVICE_NAME ":vboxNetFltSolarisQueueLoopback recycled head!! checksum=%u cLoopback=%d\n", pCur->Checksum, … … 2608 2608 pMsg = pCorrectedMsg; 2609 2609 } 2610 2611 2610 vboxNetFltSolarisAnalyzeMBlk(pMsg); 2611 2612 2612 #endif 2613 2613 … … 2809 2809 && RT_BE2H_U16(pUdpHdr->uh_dport) == 68) 2810 2810 { 2811 Log Flow((DEVICE_NAME ":UDP bootp ack D=%.6Rhxs S=%.6Rhxs UDP_CheckSum=%04x Computex=%04x\n", pb, pb + 6,2811 LogRel((DEVICE_NAME ":UDP bootp ack D=%.6Rhxs S=%.6Rhxs UDP_CheckSum=%04x Computex=%04x\n", pb, pb + 6, 2812 2812 RT_BE2H_U16(pUdpHdr->uh_sum), RT_BE2H_U16(RTNetIPv4UDPChecksum(pIpHdr, pUdpHdr, pUdpHdr + 1)))); 2813 2813 } … … 2984 2984 } 2985 2985 2986 2987 2986 /* 2988 2987 * Create a message block and send it up the host stack (upstream). … … 2997 2996 2998 2997 /* 2999 * Construct a DL_UNITDATA_IND style message.2998 * Send message up ARP stream. 3000 2999 */ 3001 mblk_t *pDlpiMsg; 3002 int rc = vboxNetFltSolarisRawToUnitData(pMsg, &pDlpiMsg); 3003 if (RT_SUCCESS(rc)) 3000 if (fArp) 3004 3001 { 3005 pMsg = pDlpiMsg; 3006 3007 if (fArp) 3002 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST ARP\n")); 3003 3004 /* 3005 * Construct a DL_UNITDATA_IND style message for ARP as it doesn't understand fast path. 3006 */ 3007 mblk_t *pDlpiMsg; 3008 int rc = vboxNetFltSolarisRawToUnitData(pMsg, &pDlpiMsg); 3009 if (RT_SUCCESS(rc)) 3008 3010 { 3009 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST ARP\n")); 3010 3011 /* 3012 * Send message up ARP stream. 3013 */ 3014 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 3011 pMsg = pDlpiMsg; 3015 3012 3016 3013 vboxnetflt_stream_t *pArpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvArpStream); … … 3018 3015 { 3019 3016 queue_t *pArpReadQueue = pArpStream->pReadQueue; 3020 Assert(pArpReadQueue);3021 3022 RTSpinlockRelease(pThis->hSpinlock, &Tmp);3023 3024 3017 putnext(pArpReadQueue, pMsg); 3025 3018 } 3026 3019 else 3027 {3028 RTSpinlockRelease(pThis->hSpinlock, &Tmp);3029 3020 rc = VERR_INVALID_POINTER; 3030 }3031 3021 } 3032 3022 else 3033 3023 { 3034 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST\n")); 3035 3036 /* 3037 * Send messages up IP stream. 3038 */ 3039 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 3040 3041 vboxnetflt_stream_t *pIpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvIpStream); 3042 if (RT_LIKELY(pIpStream)) 3043 { 3044 queue_t *pIpReadQueue = pIpStream->pReadQueue; 3045 Assert(pIpReadQueue); 3046 3047 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 3048 putnext(pIpReadQueue, pMsg); 3049 } 3050 else 3051 { 3052 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 3053 rc = VERR_INVALID_POINTER; 3054 } 3024 LogRel((DEVICE_NAME ":vboxNetFltSolarisRawToUnitData failed! rc=%d\n", rc)); 3025 freemsg(pMsg); 3026 rc = VERR_NO_MEMORY; 3055 3027 } 3056 3028 } 3057 3029 else 3058 3030 { 3059 LogRel((DEVICE_NAME ":vboxNetFltSolarisRawToUnitData failed! rc=%d\n", rc)); 3060 freemsg(pMsg); 3061 rc = VERR_NO_MEMORY; 3031 /* 3032 * Send messages up IP stream. 3033 */ 3034 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST\n")); 3035 3036 pMsg->b_rptr += sizeof(RTNETETHERHDR); 3037 3038 vboxnetflt_stream_t *pIpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvIpStream); 3039 if (RT_LIKELY(pIpStream)) 3040 { 3041 queue_t *pIpReadQueue = pIpStream->pReadQueue; 3042 putnext(pIpReadQueue, pMsg); 3043 } 3044 else 3045 rc = VERR_INVALID_POINTER; 3062 3046 } 3063 3047 }
Note:
See TracChangeset
for help on using the changeset viewer.