-rw-r--r-- | libopie2/opienet/onetwork.cpp | 2 | ||||
-rw-r--r-- | libopie2/opienet/opcap.cpp | 2 |
2 files changed, 2 insertions, 2 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 @@ -588,17 +588,17 @@ int OWirelessNetworkInterface::channel() const { return _channels[ static_cast<int>(double( _iwr.u.freq.m ) * pow( 10.0, _iwr.u.freq.e ) / 1000000) ]; } } void OWirelessNetworkInterface::setChannel( int c ) const { - if ( c ) + if ( !c ) { qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); return; } if ( !_mon ) { memset( &_iwr, 0, sizeof( struct iwreq ) ); diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 38ca1a1..6331b2d 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -1138,17 +1138,17 @@ int OPacketCapturer::fileno() const OPacket* OPacketCapturer::next( int time ) { fd_set fds; struct timeval tv; FD_ZERO( &fds ); FD_SET( pcap_fileno( _pch ), &fds ); tv.tv_sec = time / 1000; tv.tv_usec = time % 1000; - int retval = select( 1, &fds, NULL, NULL, &tv); + int retval = select( pcap_fileno( _pch )+1, &fds, NULL, NULL, &tv); if ( retval > 0 ) // clear to read! return next(); else return 0; } OPacket* OPacketCapturer::next() |