mirror of
https://github.com/akuker/RASCSI.git
synced 2025-08-10 05:24:58 +00:00
Moved initialization code
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
// The prioritized list of default interfaces
|
||||
#define DEFAULT_INTERFACES "eth0,wlan0"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Constructor
|
||||
@@ -37,7 +40,7 @@ using namespace std;
|
||||
//---------------------------------------------------------------------------
|
||||
CTapDriver::CTapDriver(const string& interfaces)
|
||||
{
|
||||
stringstream s(interfaces);
|
||||
stringstream s(!interfaces.empty() ? interfaces : DEFAULT_INTERFACES);
|
||||
string interface;
|
||||
while (getline(s, interface, ',')) {
|
||||
this->interfaces.push_back(interface);
|
||||
|
@@ -76,7 +76,7 @@ bool SCSIDaynaPort::Init(const string& interfaces)
|
||||
{
|
||||
#ifdef __linux__
|
||||
// TAP Driver Generation
|
||||
m_tap = new CTapDriver(!interfaces.empty() ? interfaces : "eth0,wlan0");
|
||||
m_tap = new CTapDriver(interfaces);
|
||||
m_bTapEnable = m_tap->Init();
|
||||
if(!m_bTapEnable){
|
||||
LOGERROR("Unable to open the TAP interface");
|
||||
|
@@ -79,7 +79,7 @@ bool SCSIBR::Init(const string& interfaces)
|
||||
{
|
||||
#ifdef __linux__
|
||||
// TAP Driver Generation
|
||||
tap = new CTapDriver(!interfaces.empty() ? interfaces : "eth0,wlan0");
|
||||
tap = new CTapDriver(interfaces);
|
||||
m_bTapEnable = tap->Init();
|
||||
|
||||
// Generate MAC Address
|
||||
|
Reference in New Issue
Block a user