Changeset 13076 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt
- Timestamp:
- Oct 8, 2008 12:36:37 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 37555
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r13068 r13076 2142 2142 * Initializes a packet identifier. 2143 2143 * 2144 * @param pMsg Pointer to the message. 2144 * @param pTag Pointer to the packed identifier. 2145 * @param pMsg Pointer to the message to be identified. 2145 2146 * 2146 2147 * @remarks Warning!!! This function assumes 'pMsg' is an unchained message. … … 2756 2757 if (RT_SUCCESS(rc)) 2757 2758 return rc; 2758 2759 2759 2760 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachToInterface failed. rc=%Vrc\n", rc)); 2760 2761 RTSemFastMutexDestroy(pThis->u.s.hFastMtx); … … 2808 2809 putnext(WR(pPromiscStream->Stream.pReadQueue), pMsg); 2809 2810 } 2810 } 2811 } 2812 2813 /* 2814 * Create a message block and send it up the host stack (upstream). 2815 */ 2811 else 2812 { 2813 LogRel((DEVICE_NAME ":vboxNetFltPortOsXmit vboxNetFltSolarisMBlkFromSG failed.\n")); 2814 rc = VERR_NO_MEMORY; 2815 } 2816 } 2817 } 2818 2816 2819 if (fDst & INTNETTRUNKDIR_HOST) 2817 2820 { 2821 /* 2822 * For unplumbed interfaces we would not be bound to IP or ARP. 2823 * We either bind to both or neither; so atomic reading one should be sufficient. 2824 */ 2825 vboxnetflt_stream_t *pIpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvIpStream); 2826 if (!pIpStream) 2827 return rc; 2828 2829 /* 2830 * Create a message block and send it up the host stack (upstream). 2831 */ 2818 2832 mblk_t *pMsg = vboxNetFltSolarisMBlkFromSG(pThis, pSG, fDst); 2819 2833 if (RT_LIKELY(pMsg)) … … 2829 2843 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST ARP\n")); 2830 2844 2831 /* 2832 * Construct a DL_UNITDATA_IND style message for ARP as it doesn't understand fast path. 2833 */ 2834 mblk_t *pDlpiMsg; 2835 int rc = vboxNetFltSolarisRawToUnitData(pMsg, &pDlpiMsg); 2836 if (RT_SUCCESS(rc)) 2845 vboxnetflt_stream_t *pArpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvArpStream); 2846 if (pArpStream) 2837 2847 { 2838 pMsg = pDlpiMsg; 2839 2840 vboxnetflt_stream_t *pArpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvArpStream); 2841 if (pArpStream) 2848 /* 2849 * Construct a DL_UNITDATA_IND style message for ARP as it doesn't understand fast path. 2850 */ 2851 mblk_t *pDlpiMsg; 2852 int rc = vboxNetFltSolarisRawToUnitData(pMsg, &pDlpiMsg); 2853 if (RT_SUCCESS(rc)) 2842 2854 { 2855 pMsg = pDlpiMsg; 2856 2843 2857 queue_t *pArpReadQueue = pArpStream->pReadQueue; 2844 2858 putnext(pArpReadQueue, pMsg); … … 2846 2860 else 2847 2861 { 2848 /* 2849 * For unplumbed interfaces we may not be bound to ARP. 2850 */ 2862 LogRel((DEVICE_NAME ":vboxNetFltSolarisRawToUnitData failed!\n")); 2851 2863 freemsg(pMsg); 2864 rc = VERR_NO_MEMORY; 2852 2865 } 2853 2866 } 2854 2867 else 2855 { 2856 LogRel((DEVICE_NAME ":vboxNetFltSolarisRawToUnitData failed! rc=%d\n", rc)); 2857 freemsg(pMsg); 2858 rc = VERR_NO_MEMORY; 2859 } 2868 freemsg(pMsg); /* Should really never happen... */ 2860 2869 } 2861 2870 else … … 2866 2875 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST\n")); 2867 2876 2868 vboxnetflt_stream_t *pIpStream = ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pvIpStream);2869 if ( pIpStream)2877 mblk_t *pMsg = vboxNetFltSolarisMBlkFromSG(pThis, pSG, fDst); 2878 if (RT_LIKELY(pMsg)) 2870 2879 { 2871 2880 pMsg->b_rptr += sizeof(RTNETETHERHDR); … … 2875 2884 else 2876 2885 { 2877 /* 2878 * For unplumbed interfaces we may not be bound to IP. 2879 */ 2886 LogRel((DEVICE_NAME ":vboxNetFltSolarisRawToUnitData failed!\n")); 2880 2887 freemsg(pMsg); 2888 rc = VERR_NO_MEMORY; 2881 2889 } 2882 2890 } 2883 2891 } 2884 2892 else 2885 rc = VERR_NO_MEMORY; 2893 { 2894 LogRel((DEVICE_NAME ":vboxNetFltSolarisMBlkFromSG failed.\n")); 2895 rc = VERR_NO_MEMORY; 2896 } 2886 2897 } 2887 2898
Note:
See TracChangeset
for help on using the changeset viewer.