Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 767651e..dc2e388 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -584,25 +584,25 @@ int OWirelessNetworkInterface::channel() const | |||
584 | { | 584 | { |
585 | return -1; | 585 | return -1; |
586 | } | 586 | } |
587 | else | 587 | else |
588 | { | 588 | { |
589 | return _channels[ static_cast<int>(double( _iwr.u.freq.m ) * pow( 10.0, _iwr.u.freq.e ) / 1000000) ]; | 589 | return _channels[ static_cast<int>(double( _iwr.u.freq.m ) * pow( 10.0, _iwr.u.freq.e ) / 1000000) ]; |
590 | } | 590 | } |
591 | } | 591 | } |
592 | 592 | ||
593 | 593 | ||
594 | void OWirelessNetworkInterface::setChannel( int c ) const | 594 | void OWirelessNetworkInterface::setChannel( int c ) const |
595 | { | 595 | { |
596 | if ( c ) | 596 | if ( !c ) |
597 | { | 597 | { |
598 | qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); | 598 | qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); |
599 | return; | 599 | return; |
600 | } | 600 | } |
601 | 601 | ||
602 | if ( !_mon ) | 602 | if ( !_mon ) |
603 | { | 603 | { |
604 | memset( &_iwr, 0, sizeof( struct iwreq ) ); | 604 | memset( &_iwr, 0, sizeof( struct iwreq ) ); |
605 | _iwr.u.freq.m = c; | 605 | _iwr.u.freq.m = c; |
606 | _iwr.u.freq.e = 0; | 606 | _iwr.u.freq.e = 0; |
607 | wioctl( SIOCSIWFREQ ); | 607 | wioctl( SIOCSIWFREQ ); |
608 | } | 608 | } |