Diffstat (limited to 'noncore/settings/networksettings/wlan/wlanimp2.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index 7ce096f..e7d6ff5 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -342,26 +342,26 @@ void WLANImp::rescanNeighbourhood() | |||
342 | wiface->setPromiscuousMode( true ); | 342 | wiface->setPromiscuousMode( true ); |
343 | 343 | ||
344 | if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) ); | 344 | if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) ); |
345 | else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) ); | 345 | else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) ); |
346 | else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); | 346 | else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); |
347 | else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); | 347 | else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); |
348 | else | 348 | else |
349 | { | 349 | { |
350 | qDebug( "rescanNeighbourhood(): unsupported device type for monitoring :(" ); | 350 | qDebug( "rescanNeighbourhood(): unsupported device type for monitoring :(" ); |
351 | return; | 351 | return; |
352 | } | 352 | } |
353 | 353 | ||
354 | wiface->setMonitorMode( true ); | 354 | wiface->setMode( "monitor" ); |
355 | if ( !wiface->monitorMode() ) | 355 | if ( wiface->mode() != "monitor" ) |
356 | { | 356 | { |
357 | qWarning( "rescanNeighbourhood(): Unable to bring device into monitor mode (%s).", strerror( errno ) ); | 357 | qWarning( "rescanNeighbourhood(): Unable to bring device into monitor mode (%s).", strerror( errno ) ); |
358 | return; | 358 | return; |
359 | } | 359 | } |
360 | 360 | ||
361 | // open a packet capturer | 361 | // open a packet capturer |
362 | OPacketCapturer* cap = new OPacketCapturer(); | 362 | OPacketCapturer* cap = new OPacketCapturer(); |
363 | cap->open( name ); | 363 | cap->open( name ); |
364 | if ( !cap->isOpen() ) | 364 | if ( !cap->isOpen() ) |
365 | { | 365 | { |
366 | qWarning( "rescanNeighbourhood(): Unable to open libpcap (%s).", strerror( errno ) ); | 366 | qWarning( "rescanNeighbourhood(): Unable to open libpcap (%s).", strerror( errno ) ); |
367 | return; | 367 | return; |
@@ -401,26 +401,26 @@ void WLANImp::rescanNeighbourhood() | |||
401 | if ( !p ) | 401 | if ( !p ) |
402 | { | 402 | { |
403 | qDebug( "rescanNeighbourhood(): nothing received on channel %d", i ); | 403 | qDebug( "rescanNeighbourhood(): nothing received on channel %d", i ); |
404 | } | 404 | } |
405 | else | 405 | else |
406 | { | 406 | { |
407 | qDebug( "rescanNeighbourhood(): TADAA - something came in on channel %d", i ); | 407 | qDebug( "rescanNeighbourhood(): TADAA - something came in on channel %d", i ); |
408 | handlePacket( p ); | 408 | handlePacket( p ); |
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | cap->close(); | 412 | cap->close(); |
413 | wiface->setMonitorMode( false ); | 413 | wiface->setMode( "managed" ); // TODO: use previous mode |
414 | wiface->setPromiscuousMode( true ); | 414 | wiface->setPromiscuousMode( false ); |
415 | 415 | ||
416 | splash->hide(); | 416 | splash->hide(); |
417 | delete splash; | 417 | delete splash; |
418 | 418 | ||
419 | } | 419 | } |
420 | 420 | ||
421 | void WLANImp::handlePacket( OPacket* p ) | 421 | void WLANImp::handlePacket( OPacket* p ) |
422 | { | 422 | { |
423 | 423 | ||
424 | // check if we received a beacon frame | 424 | // check if we received a beacon frame |
425 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); | 425 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); |
426 | if ( beacon && beacon->managementType() == "Beacon" ) | 426 | if ( beacon && beacon->managementType() == "Beacon" ) |