-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 14f251a..405eda8 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -380,24 +380,26 @@ void Wellenreiter::startClicked() // configure device ONetwork* net = ONetwork::instance(); // TODO: check if interface is wireless and support sniffing for non-wireless interfaces iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); // fails if network is not wireless! // bring device UP - iface->setUp( true ); - if ( !iface->isUp() ) + if ( cardtype != DEVTYPE_FILE ) { - QMessageBox::warning( this, "Wellenreiter II", - tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) ); - return; + iface->setUp( true ); + if ( !iface->isUp() ) + { + QMessageBox::warning( this, "Wellenreiter II", + tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) ); + return; + } } - // set monitor mode bool usePrism = configwindow->usePrismHeader(); switch ( cardtype ) { case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; @@ -449,18 +451,18 @@ void Wellenreiter::startClicked() } else { pcap->open( QFile( interface ) ); } if ( !pcap->isOpen() ) { - QMessageBox::warning( this, "Wellenreiter II", - tr( "Can't open packet capturer for '%1':\n" ).arg( iface->name() ) + QString(strerror( errno ) )); + QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( + cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); return; } // set capturer to non-blocking mode pcap->setBlocking( false ); // start channel hopper if ( cardtype != DEVTYPE_FILE ) |