Changeset 54869 in vbox
- Timestamp:
- Mar 20, 2015 1:55:12 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99080
- Location:
- trunk/src/VBox/Main/src-server/solaris
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/solaris/DynLoadLibSolaris.cpp
r48955 r54869 28 28 * and symbols have been successfully loaded. 29 29 */ 30 static RTLDRMOD g_hLibDlpi = N ULL;30 static RTLDRMOD g_hLibDlpi = NIL_RTLDRMOD; 31 31 32 32 /** … … 41 41 */ 42 42 int (*g_pfnLibDlpiWalk)(dlpi_walkfunc_t *, void *, uint_t); 43 int (*g_pfnLibDlpiOpen)(const char *, dlpi_handle_t *, uint_t); 44 void (*g_pfnLibDlpiClose)(dlpi_handle_t); 43 45 /** @} */ 44 46 … … 47 49 RTLDRMOD hLibDlpi; 48 50 49 if (g_hLibDlpi && g_fCheckedForLibDlpi)50 return true;51 51 if (g_fCheckedForLibDlpi) 52 return false; 53 if (!RT_SUCCESS(RTLdrLoad(LIB_DLPI, &hLibDlpi))) 54 return false; 55 /* 56 * Unfortunately; we cannot make use of dlpi_get_physaddr because it requires us to 57 * open the VNIC/link which requires root permissions :/ 58 */ 59 if (RT_SUCCESS(RTLdrGetSymbol(hLibDlpi, "dlpi_walk", (void **)&g_pfnLibDlpiWalk))) 52 return g_hLibDlpi != NIL_RTLDRMOD; 53 g_fCheckedForLibDlpi = true; 54 int rc = RTLdrLoad(LIB_DLPI, &hLibDlpi); 55 if (RT_SUCCESS(rc)) 60 56 { 61 g_hLibDlpi = hLibDlpi; 62 g_fCheckedForLibDlpi = true; 63 return true; 57 /* 58 * Unfortunately; we cannot make use of dlpi_get_physaddr because it requires us to 59 * open the VNIC/link which requires root permissions :/ 60 */ 61 rc = RTLdrGetSymbol(hLibDlpi, "dlpi_walk", (void **)&g_pfnLibDlpiWalk); 62 rc |= RTLdrGetSymbol(hLibDlpi, "dlpi_close", (void **)&g_pfnLibDlpiClose); 63 rc |= RTLdrGetSymbol(hLibDlpi, "dlpi_open", (void **)&g_pfnLibDlpiOpen); 64 if (RT_SUCCESS(rc)) 65 { 66 g_hLibDlpi = hLibDlpi; 67 return true; 68 } 69 70 RTLdrClose(hLibDlpi); 64 71 } 65 else 66 { 67 RTLdrClose(hLibDlpi); 68 g_fCheckedForLibDlpi = true; 69 return false; 70 } 72 hLibDlpi = NIL_RTLDRMOD; 73 return false; 71 74 } 72 75 -
trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
r54838 r54869 176 176 SolarisNICMap.insert(NICPair("spwr", "SMC EtherPower II 10/100 (9432) Ethernet")); 177 177 SolarisNICMap.insert(NICPair("vboxnet", "VirtualBox Host Ethernet")); 178 SolarisNICMap.insert(NICPair(VBOXBOW_VNIC_TEMPLATE_NAME, "VirtualBox V irtual Network InterfaceTemplate"));178 SolarisNICMap.insert(NICPair(VBOXBOW_VNIC_TEMPLATE_NAME, "VirtualBox VNIC Template")); 179 179 SolarisNICMap.insert(NICPair("vlan", "Virtual LAN Ethernet")); 180 180 SolarisNICMap.insert(NICPair("vr", "VIA Rhine Fast Ethernet")); … … 384 384 NOREF(Minor); 385 385 386 char *pszDriverName = di_driver_name(Node); 387 int Instance = di_instance(Node); 388 386 389 /* 387 390 * Skip aggregations. 388 391 */ 389 if (!strcmp( di_driver_name(Node), "aggr"))392 if (!strcmp(pszDriverName, "aggr")) 390 393 return DI_WALK_CONTINUE; 391 394 … … 393 396 * Skip softmacs. 394 397 */ 395 if (!strcmp( di_driver_name(Node), "softmac"))398 if (!strcmp(pszDriverName, "softmac")) 396 399 return DI_WALK_CONTINUE; 397 400 398 vboxSolarisAddHostIface(di_driver_name(Node), di_instance(Node), pvHostNetworkInterfaceList); 401 /* 402 * Driver names doesn't always imply the same link name probably since 403 * S11's vanity names by default (e.g. highly descriptive "net0") names 404 * was introduced. Try opening the link to find out if it really exists. 405 */ 406 if (VBoxSolarisLibDlpiFound()) 407 { 408 /** @todo should we try also opening "linkname+instance"? */ 409 dlpi_handle_t hLink; 410 if (g_pfnLibDlpiOpen(pszDriverName, &hLink, 0) != DLPI_SUCCESS) 411 return DI_WALK_CONTINUE; 412 g_pfnLibDlpiClose(hLink); 413 } 414 415 vboxSolarisAddHostIface(pszDriverName, Instance, pvHostNetworkInterfaceList); 399 416 return DI_WALK_CONTINUE; 400 417 } … … 402 419 int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list) 403 420 { 404 405 421 /* 406 422 * Use libdevinfo for determining all physical interfaces. … … 410 426 if (Root != DI_NODE_NIL) 411 427 { 412 di_walk_minor(Root, DDI_NT_NET, 0 , &list, vboxSolarisAddPhysHostIface);428 di_walk_minor(Root, DDI_NT_NET, 0 /* flag */, &list, vboxSolarisAddPhysHostIface); 413 429 di_fini(Root); 414 430 }
Note:
See TracChangeset
for help on using the changeset viewer.