- Timestamp:
- Sep 24, 2009 12:22:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r23062 r23281 384 384 385 385 /** Goes along with the instance to determine type of stream being opened/created. */ 386 VBOXNETFLTSTREAMTYPE volatile g_VBoxNetFltSolarisStreamType ;386 VBOXNETFLTSTREAMTYPE volatile g_VBoxNetFltSolarisStreamType = kUndefined; 387 387 388 388 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING … … 664 664 * Check VirtualBox stream type. 665 665 */ 666 if (g_VBoxNetFltSolarisStreamType == kUndefined) 667 { 668 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed due to undefined VirtualBox open mode.\n")); 666 if ( g_VBoxNetFltSolarisStreamType != kPromiscStream 667 && g_VBoxNetFltSolarisStreamType != kArpStream 668 && g_VBoxNetFltSolarisStreamType != kIp6Stream 669 && g_VBoxNetFltSolarisStreamType != kIp4Stream) 670 { 671 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed due to undefined VirtualBox open mode. Type=%d\n", g_VBoxNetFltSolarisStreamType)); 669 672 RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx); 670 673 return ENOENT; … … 741 744 default: /* Heh. */ 742 745 { 743 AssertRelease(pStream->Type); 744 break; 746 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen huh!? Invalid stream type %d\n", pStream->Type)); 747 RTMemFree(pStream); 748 RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx); 749 return EINVAL; 745 750 } 746 751 } … … 754 759 pStream->pNext = *ppPrevStream; 755 760 *ppPrevStream = pStream; 761 762 /* 763 * Increment IntNet reference count for this stream. 764 */ 765 vboxNetFltRetain(pThis, false /* fBusy */); 756 766 757 767 /* … … 841 851 { 842 852 LogRel((DEVICE_NAME ":VBoxNetFltSolarisModClose failed to get stream.\n")); 843 vboxNetFltRelease(pStream->pThis, false /* fBusy */);844 853 RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx); 845 854 return ENXIO; … … 914 923 } 915 924 925 /* 926 * Decrement IntNet reference count for this stream. 927 */ 916 928 vboxNetFltRelease(pStream->pThis, false /* fBusy */); 929 917 930 RTMemFree(pStream); 918 931 pQueue->q_ptr = NULL; … … 1753 1766 } 1754 1767 1755 LogRel((DEVICE_NAME ":vboxNetFltSolarisDetermineModPos: failed to find %s in the host stack.\n" ));1768 LogRel((DEVICE_NAME ":vboxNetFltSolarisDetermineModPos: failed to find %s in the host stack.\n", DEVICE_NAME)); 1756 1769 } 1757 1770 else … … 1916 1929 { 1917 1930 LogFlow((DEVICE_NAME ":vboxNetFltSolarisCloseStream pThis=%p\n")); 1918 1919 vboxNetFltRetain(pThis, false /* fBusy */);1920 1931 1921 1932 ldi_close(pThis->u.s.hIface, FREAD | FWRITE, kcred); … … 2047 2058 * Inject/Eject from the host IP stack. 2048 2059 */ 2049 if (!fAttach)2050 vboxNetFltRetain(pThis, false /* fBusy */);2051 2060 2052 2061 /* … … 2066 2075 if (!rc) 2067 2076 { 2068 if (!fAttach)2069 vboxNetFltRetain(pThis, false /* fBusy */);2070 2071 2077 /* 2072 2078 * Inject/Eject from the host ARP stack. … … 2127 2133 2128 2134 vboxNetFltSolarisRelinkIp4(pUdp4VNode, &Ip4Interface, Ip4MuxFd, ArpMuxFd); 2129 2130 if (!fAttach)2131 vboxNetFltRelease(pThis, false /* fBusy */);2132 2135 } 2133 2136 else … … 2139 2142 g_VBoxNetFltSolarisInstance = NULL; 2140 2143 g_VBoxNetFltSolarisStreamType = kUndefined; 2141 2142 if (!fAttach)2143 vboxNetFltRelease(pThis, false /* fBusy */);2144 2144 } 2145 2145 else … … 2279 2279 if (RT_SUCCESS(rc)) 2280 2280 { 2281 if (!fAttach)2282 vboxNetFltRetain(pThis, false /* fBusy */);2283 2284 2281 /* 2285 2282 * Set global data which will be grabbed by ModOpen. … … 2335 2332 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachIp6: failed to %s the IP stack. rc=%d\n", 2336 2333 fAttach ? "inject into" : "eject from", rc)); 2337 if (!fAttach)2338 vboxNetFltRelease(pThis, false /* fBusy */);2339 2334 } 2340 2335 } … … 2477 2472 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 2478 2473 vboxNetFltSolarisCloseStream(pThis); 2479 int rc = vboxNetFltSolarisAttachIp4(pThis, false /* fAttach */); 2474 int rc = VINF_SUCCESS; 2475 if (pThis->u.s.pvIp4Stream) 2476 rc = vboxNetFltSolarisAttachIp4(pThis, false /* fAttach */); 2480 2477 if (pThis->u.s.pvIp6Stream) 2481 2478 rc = vboxNetFltSolarisAttachIp6(pThis, false /* fAttach */);
Note:
See TracChangeset
for help on using the changeset viewer.