Moved initialization code

This commit is contained in:
Uwe Seimet
2021-08-29 08:31:57 +02:00
parent 1a615a6c6f
commit 3a1aaaf68b
3 changed files with 6 additions and 3 deletions

View File

@@ -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);

View File

@@ -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");

View File

@@ -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