~ubuntu-branches/ubuntu/vivid/virtualbox-ose/vivid

« back to all changes in this revision

Viewing changes to src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-10-13 23:06:00 UTC
  • mfrom: (0.3.2 upstream) (0.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091013230600-xhu2pwizq0wo63l9
Tags: 3.0.8-dfsg-1ubuntu1
* Merge from debian unstable (LP: #444812), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
* Try to remove existing dkms modules before adding the new modules
  (LP: #434503)
  - debian/virtualbox-ose-source.postinst
  - debian/virtualbox-ose-guest-source.postinst
* Don't fail if dkms modules have already been removed
  - debian/virtualbox-ose-source.prerm
  - debian/virtualbox-ose-guest-source.prerm

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
static VBOXNETFLTGLOBALS g_VBoxNetFltSolarisGlobals;
366
366
 
367
367
/** The list of all opened streams. */
368
 
vboxnetflt_stream_t *g_VBoxNetFltSolarisStreams;
 
368
vboxnetflt_stream_t *g_VBoxNetFltSolarisStreams = NULL;
369
369
 
370
370
/** Global mutex protecting open/close. */
371
371
static RTSEMFASTMUTEX g_VBoxNetFltSolarisMtx = NIL_RTSEMFASTMUTEX;
372
372
 
 
373
/** Global credentials using during open/close. */
 
374
static cred_t *g_pVBoxNetFltSolarisCred = NULL;
 
375
 
373
376
/**
374
377
 * g_VBoxNetFltInstance is the current PVBOXNETFLTINS to be associated with the stream being created
375
378
 * in ModOpen. This is just shared global data between the dynamic attach and the ModOpen procedure.
376
379
 */
377
 
PVBOXNETFLTINS volatile g_VBoxNetFltSolarisInstance;
 
380
PVBOXNETFLTINS volatile g_VBoxNetFltSolarisInstance = NULL;
378
381
 
379
382
/** Goes along with the instance to determine type of stream being opened/created. */
380
 
VBOXNETFLTSTREAMTYPE volatile g_VBoxNetFltSolarisStreamType;
 
383
VBOXNETFLTSTREAMTYPE volatile g_VBoxNetFltSolarisStreamType = kUndefined;
381
384
 
382
385
 
383
386
/**
407
410
         */
408
411
        g_VBoxNetFltSolarisStreams = NULL;
409
412
        g_VBoxNetFltSolarisInstance = NULL;
410
 
 
411
 
        int rc = RTSemFastMutexCreate(&g_VBoxNetFltSolarisMtx);
412
 
        if (RT_SUCCESS(rc))
 
413
        g_pVBoxNetFltSolarisCred = crdup(kcred);
 
414
        if (RT_LIKELY(g_pVBoxNetFltSolarisCred))
413
415
        {
414
 
            /*
415
 
             * Initialize the globals and connect to the support driver.
416
 
             *
417
 
             * This will call back vboxNetFltOsOpenSupDrv (and maybe vboxNetFltOsCloseSupDrv)
418
 
             * for establishing the connect to the support driver.
419
 
             */
420
 
            memset(&g_VBoxNetFltSolarisGlobals, 0, sizeof(g_VBoxNetFltSolarisGlobals));
421
 
            rc = vboxNetFltInitGlobalsAndIdc(&g_VBoxNetFltSolarisGlobals);
 
416
            rc = RTSemFastMutexCreate(&g_VBoxNetFltSolarisMtx);
422
417
            if (RT_SUCCESS(rc))
423
418
            {
424
 
                rc = mod_install(&g_VBoxNetFltSolarisModLinkage);
425
 
                if (!rc)
426
 
                    return rc;
427
 
 
428
 
                LogRel((DEVICE_NAME ":mod_install failed. rc=%d\n", rc));
429
 
                vboxNetFltTryDeleteIdcAndGlobals(&g_VBoxNetFltSolarisGlobals);
 
419
                /*
 
420
                 * Initialize the globals and connect to the support driver.
 
421
                 *
 
422
                 * This will call back vboxNetFltOsOpenSupDrv (and maybe vboxNetFltOsCloseSupDrv)
 
423
                 * for establishing the connect to the support driver.
 
424
                 */
 
425
                memset(&g_VBoxNetFltSolarisGlobals, 0, sizeof(g_VBoxNetFltSolarisGlobals));
 
426
                rc = vboxNetFltInitGlobalsAndIdc(&g_VBoxNetFltSolarisGlobals);
 
427
                if (RT_SUCCESS(rc))
 
428
                {
 
429
                    rc = mod_install(&g_VBoxNetFltSolarisModLinkage);
 
430
                    if (!rc)
 
431
                        return rc;
 
432
 
 
433
                    LogRel((DEVICE_NAME ":mod_install failed. rc=%d\n", rc));
 
434
                    vboxNetFltTryDeleteIdcAndGlobals(&g_VBoxNetFltSolarisGlobals);
 
435
                }
 
436
                else
 
437
                    LogRel((DEVICE_NAME ":failed to initialize globals.\n"));
 
438
 
 
439
                RTSemFastMutexDestroy(g_VBoxNetFltSolarisMtx);
 
440
                g_VBoxNetFltSolarisMtx = NIL_RTSEMFASTMUTEX;
430
441
            }
431
 
            else
432
 
                LogRel((DEVICE_NAME ":failed to initialize globals.\n"));
433
 
 
434
 
            RTSemFastMutexDestroy(g_VBoxNetFltSolarisMtx);
435
 
            g_VBoxNetFltSolarisMtx = NIL_RTSEMFASTMUTEX;
 
442
        }
 
443
        else
 
444
        {
 
445
            LogRel((DEVICE_NAME ":failed to allocate credentials.\n"));
 
446
            rc = VERR_NO_MEMORY;
436
447
        }
437
448
 
438
449
        RTR0Term();
460
471
        return EBUSY;
461
472
    }
462
473
 
 
474
    if (g_pVBoxNetFltSolarisCred)
 
475
    {
 
476
        crfree(g_pVBoxNetFltSolarisCred);
 
477
        g_pVBoxNetFltSolarisCred = NULL;
 
478
    }
 
479
 
463
480
    if (g_VBoxNetFltSolarisMtx != NIL_RTSEMFASTMUTEX)
464
481
    {
465
482
        RTSemFastMutexDestroy(g_VBoxNetFltSolarisMtx);
606
623
    LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModOpen pQueue=%p pDev=%p fOpenMode=%d fStreamMode=%d\n", pQueue, pDev,
607
624
            fOpenMode, fStreamMode));
608
625
 
609
 
    int rc = RTSemFastMutexRequest(g_VBoxNetFltSolarisMtx);
610
 
    AssertRCReturn(rc, rc);
611
 
 
612
626
    /*
613
627
     * Already open?
614
628
     */
615
629
    if (pQueue->q_ptr)
616
630
    {
617
631
        LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen invalid open.\n"));
618
 
        RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
619
632
        return ENOENT;
620
633
    }
621
634
 
622
635
    /*
 
636
     * Check that the request was initiated by our code.
 
637
     *
 
638
     * This ASSUMES that crdup() will return a copy with a unique address and
 
639
     * not do any kind of clever pooling.  This check will when combined with
 
640
     * g_VBoxNetFltSolarisMtx prevent races and that the instance gets
 
641
     * associated with the wrong streams.
 
642
     */
 
643
    if (pCred != g_pVBoxNetFltSolarisCred)
 
644
    {
 
645
        LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen invalid credentials.\n"));
 
646
        return EACCES;
 
647
    }
 
648
 
 
649
    /*
623
650
     * Check for the VirtualBox instance.
624
651
     */
625
652
    PVBOXNETFLTINS pThis = g_VBoxNetFltSolarisInstance;
626
653
    if (!pThis)
627
654
    {
628
655
        LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed to get VirtualBox instance.\n"));
629
 
        RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
630
656
        return ENOENT;
631
657
    }
632
658
 
633
659
    /*
634
660
     * Check VirtualBox stream type.
635
661
     */
636
 
    if (g_VBoxNetFltSolarisStreamType == kUndefined)
 
662
    if (   g_VBoxNetFltSolarisStreamType != kPromiscStream
 
663
        && g_VBoxNetFltSolarisStreamType != kArpStream
 
664
        && g_VBoxNetFltSolarisStreamType != kIp6Stream
 
665
        && g_VBoxNetFltSolarisStreamType != kIp4Stream)
637
666
    {
638
 
        LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed due to undefined VirtualBox open mode.\n"));
639
 
        RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
 
667
        LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed due to undefined VirtualBox open mode. Type=%d\n", g_VBoxNetFltSolarisStreamType));
640
668
        return ENOENT;
641
669
    }
642
670
 
665
693
        if (RT_UNLIKELY(!pPromiscStream))
666
694
        {
667
695
            LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed to allocate promiscuous stream data.\n"));
668
 
            RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
669
696
            return ENOMEM;
670
697
        }
671
698
 
686
713
        if (RT_UNLIKELY(!pStream))
687
714
        {
688
715
            LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen failed to allocate stream data.\n"));
689
 
            RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
690
716
            return ENOMEM;
691
717
        }
692
718
    }
707
733
        case kPromiscStream:    ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pvPromiscStream, pStream);    break;
708
734
        default:    /* Heh. */
709
735
        {
710
 
            AssertRelease(pStream->Type);
711
 
            break;
 
736
            LogRel((DEVICE_NAME ":VBoxNetFltSolarisModOpen huh!? Invalid stream type %d\n", pStream->Type));
 
737
            RTMemFree(pStream);
 
738
            return EINVAL;
712
739
        }
713
740
    }
714
741
 
722
749
    *ppPrevStream = pStream;
723
750
 
724
751
    /*
725
 
     * Release global lock, & do not hold locks across putnext calls.
 
752
     * Increment IntNet reference count for this stream.
726
753
     */
727
 
    RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
 
754
    vboxNetFltRetain(pThis, false /* fBusy */);
728
755
 
729
756
    qprocson(pQueue);
730
757
 
771
798
    }
772
799
 
773
800
    NOREF(fOpenMode);
774
 
    NOREF(pCred);
775
801
 
776
802
    LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModOpen returns 0, DevMinor=%d pQueue=%p\n", DevMinor, pStream->pReadQueue));
777
803
 
794
820
 
795
821
    LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModClose pQueue=%p fOpenMode=%d\n", pQueue, fOpenMode));
796
822
 
797
 
    int rc = RTSemFastMutexRequest(g_VBoxNetFltSolarisMtx);
798
 
    AssertRCReturn(rc, rc);
799
 
 
800
823
    vboxnetflt_stream_t *pStream = NULL;
801
824
    vboxnetflt_stream_t **ppPrevStream = NULL;
802
825
 
807
830
    if (RT_UNLIKELY(!pStream))
808
831
    {
809
832
        LogRel((DEVICE_NAME ":VBoxNetFltSolarisModClose failed to get stream.\n"));
810
 
        vboxNetFltRelease(pStream->pThis, false /* fBusy */);
811
 
        RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
812
833
        return ENXIO;
813
834
    }
814
835
 
868
889
        }
869
890
    }
870
891
 
 
892
    /*
 
893
     * Decrement IntNet reference count for this stream.
 
894
     */
871
895
    vboxNetFltRelease(pStream->pThis, false /* fBusy */);
 
896
 
872
897
    RTMemFree(pStream);
873
898
    pQueue->q_ptr = NULL;
874
899
    WR(pQueue)->q_ptr = NULL;
876
901
    NOREF(fOpenMode);
877
902
    NOREF(pCred);
878
903
 
879
 
    RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
880
 
 
881
904
    return 0;
882
905
}
883
906
 
1687
1710
                }
1688
1711
            }
1689
1712
 
1690
 
            LogRel((DEVICE_NAME ":vboxNetFltSolarisDetermineModPos: failed to find %s in the host stack.\n"));
 
1713
            LogRel((DEVICE_NAME ":vboxNetFltSolarisDetermineModPos: failed to find %s in the host stack.\n", DEVICE_NAME));
1691
1714
        }
1692
1715
        else
1693
1716
            LogRel((DEVICE_NAME ":vboxNetFltSolarisDetermineModPos: failed to get module information. rc=%d\n"));
1819
1842
    {
1820
1843
        if (!ret)
1821
1844
        {
1822
 
            g_VBoxNetFltSolarisInstance = pThis;
1823
 
            g_VBoxNetFltSolarisStreamType = kPromiscStream;
1824
 
 
1825
 
            rc = ldi_ioctl(pThis->u.s.hIface, I_PUSH, (intptr_t)DEVICE_NAME, FKIOCTL, kcred, &ret);
1826
 
 
1827
 
            g_VBoxNetFltSolarisInstance = NULL;
1828
 
            g_VBoxNetFltSolarisStreamType = kUndefined;
 
1845
            if (RT_LIKELY(g_pVBoxNetFltSolarisCred))        /* Paranoia */
 
1846
            {
 
1847
                rc = RTSemFastMutexRequest(g_VBoxNetFltSolarisMtx);
 
1848
                AssertRCReturn(rc, rc);
 
1849
 
 
1850
                g_VBoxNetFltSolarisInstance = pThis;
 
1851
                g_VBoxNetFltSolarisStreamType = kPromiscStream;
 
1852
 
 
1853
                rc = ldi_ioctl(pThis->u.s.hIface, I_PUSH, (intptr_t)DEVICE_NAME, FKIOCTL, g_pVBoxNetFltSolarisCred, &ret);
 
1854
 
 
1855
                g_VBoxNetFltSolarisInstance = NULL;
 
1856
                g_VBoxNetFltSolarisStreamType = kUndefined;
 
1857
 
 
1858
                RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
 
1859
            }
 
1860
            else
 
1861
            {
 
1862
                LogRel((DEVICE_NAME ":vboxNetFltSolarisOpenStream huh!? Missing credentials.\n"));
 
1863
                rc = VERR_INVALID_POINTER;
 
1864
            }
1829
1865
 
1830
1866
            if (!rc)
1831
1867
                return VINF_SUCCESS;
1838
1874
    else
1839
1875
        LogRel((DEVICE_NAME ":vboxNetFltSolarisOpenStream Failed to search for filter in interface '%s'.\n", pThis->szName));
1840
1876
 
 
1877
    ldi_close(pThis->u.s.hIface, FREAD | FWRITE, kcred);
 
1878
 
1841
1879
    return VERR_INTNET_FLT_IF_FAILED;
1842
1880
}
1843
1881
 
1851
1889
{
1852
1890
    LogFlow((DEVICE_NAME ":vboxNetFltSolarisCloseStream pThis=%p\n"));
1853
1891
 
1854
 
    vboxNetFltRetain(pThis, false /* fBusy */);
1855
 
 
1856
1892
    ldi_close(pThis->u.s.hIface, FREAD | FWRITE, kcred);
1857
1893
}
1858
1894
 
1981
2017
                                /*
1982
2018
                                 * Inject/Eject from the host IP stack.
1983
2019
                                 */
1984
 
                                if (!fAttach)
1985
 
                                    vboxNetFltRetain(pThis, false /* fBusy */);
1986
2020
 
1987
2021
                                /*
1988
2022
                                 * Set global data which will be grabbed by ModOpen.
1989
2023
                                 * There is a known (though very unlikely) race here because
1990
2024
                                 * of the inability to pass user data while inserting.
1991
2025
                                 */
1992
 
                                g_VBoxNetFltSolarisInstance = pThis;
1993
 
                                g_VBoxNetFltSolarisStreamType = kIp4Stream;
 
2026
                                rc = RTSemFastMutexRequest(g_VBoxNetFltSolarisMtx);
 
2027
                                AssertRCReturn(rc, rc);
 
2028
 
 
2029
                                if (fAttach)
 
2030
                                {
 
2031
                                    g_VBoxNetFltSolarisInstance = pThis;
 
2032
                                    g_VBoxNetFltSolarisStreamType = kIp4Stream;
 
2033
                                }
1994
2034
 
1995
2035
                                rc = strioctl(pIp4VNode, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K,
1996
 
                                            kcred, &ret);
1997
 
 
1998
 
                                g_VBoxNetFltSolarisInstance = NULL;
1999
 
                                g_VBoxNetFltSolarisStreamType = kUndefined;
 
2036
                                            g_pVBoxNetFltSolarisCred, &ret);
 
2037
 
 
2038
                                if (fAttach)
 
2039
                                {
 
2040
                                    g_VBoxNetFltSolarisInstance = NULL;
 
2041
                                    g_VBoxNetFltSolarisStreamType = kUndefined;
 
2042
                                }
 
2043
 
 
2044
                                RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
2000
2045
 
2001
2046
                                if (!rc)
2002
2047
                                {
2003
 
                                    if (!fAttach)
2004
 
                                        vboxNetFltRetain(pThis, false /* fBusy */);
2005
 
 
2006
2048
                                    /*
2007
2049
                                     * Inject/Eject from the host ARP stack.
2008
2050
                                     */
2009
 
                                    g_VBoxNetFltSolarisInstance = pThis;
2010
 
                                    g_VBoxNetFltSolarisStreamType = kArpStream;
 
2051
                                    rc = RTSemFastMutexRequest(g_VBoxNetFltSolarisMtx);
 
2052
                                    AssertRCReturn(rc, rc);
 
2053
 
 
2054
                                    if (fAttach)
 
2055
                                    {
 
2056
                                        g_VBoxNetFltSolarisInstance = pThis;
 
2057
                                        g_VBoxNetFltSolarisStreamType = kArpStream;
 
2058
                                    }
2011
2059
 
2012
2060
                                    rc = strioctl(pArpVNode, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&ArpStrMod, 0, K_TO_K,
2013
 
                                                kcred, &ret);
2014
 
 
2015
 
                                    g_VBoxNetFltSolarisInstance = NULL;
2016
 
                                    g_VBoxNetFltSolarisStreamType = kUndefined;
 
2061
                                                g_pVBoxNetFltSolarisCred, &ret);
 
2062
 
 
2063
                                    if (fAttach)
 
2064
                                    {
 
2065
                                        g_VBoxNetFltSolarisInstance = NULL;
 
2066
                                        g_VBoxNetFltSolarisStreamType = kUndefined;
 
2067
                                    }
 
2068
 
 
2069
                                    RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
2017
2070
 
2018
2071
                                    if (!rc)
2019
2072
                                    {
2061
2114
                                        strioctl(pIp4VNode, _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K, kcred, &ret);
2062
2115
 
2063
2116
                                    vboxNetFltSolarisRelinkIp4(pUdp4VNode, &Ip4Interface, Ip4MuxFd, ArpMuxFd);
2064
 
 
2065
 
                                    if (!fAttach)
2066
 
                                        vboxNetFltRelease(pThis, false /* fBusy */);
2067
2117
                                }
2068
2118
                                else
2069
2119
                                {
2070
2120
                                    LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachIp4: failed to %s the IP stack. rc=%d\n",
2071
2121
                                            fAttach ? "inject into" : "eject from", rc));
2072
2122
                                }
2073
 
 
2074
 
                                g_VBoxNetFltSolarisInstance = NULL;
2075
 
                                g_VBoxNetFltSolarisStreamType = kUndefined;
2076
 
 
2077
 
                                if (!fAttach)
2078
 
                                    vboxNetFltRelease(pThis, false /* fBusy */);
2079
2123
                            }
2080
2124
                            else
2081
2125
                                LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachIp4: failed to find position. rc=%d rc2=%d\n", rc, rc2));
2214
2258
                            rc = vboxNetFltSolarisDetermineModPos(fAttach, pIp6VNode, &StrMod.pos);
2215
2259
                            if (RT_SUCCESS(rc))
2216
2260
                            {
2217
 
                                if (!fAttach)
2218
 
                                    vboxNetFltRetain(pThis, false /* fBusy */);
2219
 
 
2220
2261
                                /*
2221
2262
                                 * Set global data which will be grabbed by ModOpen.
2222
2263
                                 * There is a known (though very unlikely) race here because
2223
2264
                                 * of the inability to pass user data while inserting.
2224
2265
                                 */
2225
 
                                g_VBoxNetFltSolarisInstance = pThis;
2226
 
                                g_VBoxNetFltSolarisStreamType = kIp6Stream;
 
2266
                                rc = RTSemFastMutexRequest(g_VBoxNetFltSolarisMtx);
 
2267
                                AssertRCReturn(rc, rc);
 
2268
 
 
2269
                                if (fAttach)
 
2270
                                {
 
2271
                                    g_VBoxNetFltSolarisInstance = pThis;
 
2272
                                    g_VBoxNetFltSolarisStreamType = kIp6Stream;
 
2273
                                }
2227
2274
 
2228
2275
                                /*
2229
2276
                                 * Inject/Eject from the host IPv6 stack.
2230
2277
                                 */
2231
2278
                                rc = strioctl(pIp6VNode, fAttach ? _I_INSERT : _I_REMOVE, (intptr_t)&StrMod, 0, K_TO_K,
2232
 
                                            kcred, &ret);
2233
 
                                if (!rc)
 
2279
                                            g_pVBoxNetFltSolarisCred, &ret);
 
2280
 
 
2281
                                if (fAttach)
2234
2282
                                {
2235
2283
                                    g_VBoxNetFltSolarisInstance = NULL;
2236
2284
                                    g_VBoxNetFltSolarisStreamType = kUndefined;
2237
 
 
 
2285
                                }
 
2286
 
 
2287
                                RTSemFastMutexRelease(g_VBoxNetFltSolarisMtx);
 
2288
 
 
2289
                                if (!rc)
 
2290
                                {
2238
2291
                                    /*
2239
2292
                                     * Our job's not yet over; we need to relink the upper and lower streams
2240
2293
                                     * otherwise we've pretty much screwed up the host interface.
2270
2323
                                {
2271
2324
                                    LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachIp6: failed to %s the IP stack. rc=%d\n",
2272
2325
                                            fAttach ? "inject into" : "eject from", rc));
2273
 
                                    if (!fAttach)
2274
 
                                        vboxNetFltRelease(pThis, false /* fBusy */);
2275
2326
                                }
2276
2327
                            }
2277
2328
                            else
2350
2401
 
2351
2402
    ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true);
2352
2403
    vboxNetFltSolarisCloseStream(pThis);
2353
 
    int rc = vboxNetFltSolarisAttachIp4(pThis, false /* fAttach */);
 
2404
    int rc = VINF_SUCCESS;
 
2405
    if (pThis->u.s.pvIp4Stream)
 
2406
        rc = vboxNetFltSolarisAttachIp4(pThis, false /* fAttach */);
2354
2407
    if (pThis->u.s.pvIp6Stream)
2355
2408
        rc = vboxNetFltSolarisAttachIp6(pThis, false /* fAttach */);
2356
2409