summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp12
-rw-r--r--libopie2/opienet/onetwork.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 45ee4c0..767651e 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -592,8 +592,14 @@ int OWirelessNetworkInterface::channel() const
void OWirelessNetworkInterface::setChannel( int c ) const
{
+ if ( c )
+ {
+ qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" );
+ return;
+ }
+
if ( !_mon )
{
memset( &_iwr, 0, sizeof( struct iwreq ) );
_iwr.u.freq.m = c;
@@ -938,9 +944,9 @@ void OWlanNGMonitoringInterface::setChannel( int c )
QString enable = "true"; //_if->monitorMode() ? "true" : "false";
QString prism = _prismHeader ? "true" : "false";
QString cmd;
cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s",
- (const char*) _if->name(), c+1, (const char*) enable, (const char*) prism );
+ (const char*) _if->name(), c, (const char*) enable, (const char*) prism );
system( cmd );
}
@@ -1014,10 +1020,12 @@ void OOrinocoMonitoringInterface::setChannel( int c )
void OOrinocoMonitoringInterface::setEnabled( bool b )
{
// IW_MODE_MONITOR was introduced in Wireless Extensions Version 15
// Wireless Extensions < Version 15 need iwpriv commandos for monitoring
+ // However, as of recent orinoco drivers, IW_MODE_MONITOR is still not supported
- #if WIRELESS_EXT > 14
+ #if 0
+ //#if WIRELESS_EXT > 14
if ( b )
_if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header
else
_if->setMode( "managed" );
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 2553a61..00d1ebb 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -335,8 +335,10 @@ class OWirelessNetworkInterface : public ONetworkInterface
virtual ~OWirelessNetworkInterface();
/**
* Setting the @a channel of the interface changes the radio frequency (RF)
* of the corresponding wireless network device.
+ * @note Common channel range is within [1-14]. A value of 0 is not allowed.
+ * @see channels()
*/
virtual void setChannel( int channel ) const;
/**
* @returns the channel index of the current radio frequency.