VirtualBox

Changeset 12862 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Oct 1, 2008 12:55:02 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37249
Message:

Solaris/vboxnetflt: Made it possible to use VNICs with NetFlt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c

    r12825 r12862  
    15091509    int ret;
    15101510
     1511    /*
     1512     * Try style-1 open first.
     1513     */
    15111514    char szDev[128];
    1512     RTStrPrintf(szDev, sizeof(szDev), "/dev/%s", pThis->szName);
    1513 
     1515    RTStrPrintf(szDev, sizeof(szDev), "/dev/net/%s", pThis->szName);
    15141516    int rc = ldi_open_by_name(szDev, FREAD | FWRITE, kcred, &pThis->u.s.hIface, DevId);
    1515     ldi_ident_release(DevId);
    1516     if (rc)
    1517     {
    1518         LogRel((DEVICE_NAME ":vboxNetFltSolarisOpenStream Failed to open '%s'\n", szDev));
    1519         return VERR_INTNET_FLT_IF_FAILED;
    1520     }
     1517    if (   rc
     1518        && rc == ENODEV)
     1519    {
     1520        /*
     1521         * Fallback to style-2 open.
     1522         */
     1523        RTStrPrintf(szDev, sizeof(szDev), "/dev/%s", pThis->szName);
     1524        rc = ldi_open_by_name(szDev, FREAD | FWRITE, kcred, &pThis->u.s.hIface, DevId);
     1525        ldi_ident_release(DevId);
     1526        if (rc)
     1527        {
     1528            LogRel((DEVICE_NAME ":vboxNetFltSolarisOpenStream Failed to open '%s' rc=%d\n", szDev, rc));
     1529            return VERR_INTNET_FLT_IF_FAILED;
     1530        }
     1531    }
     1532    else
     1533        ldi_ident_release(DevId);   
    15211534
    15221535    rc = ldi_ioctl(pThis->u.s.hIface, I_FIND, (intptr_t)DEVICE_NAME, FKIOCTL, kcred, &ret);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette