summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp6
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp15
2 files changed, 16 insertions, 5 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 1525934..1ef24d2 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -275,5 +275,5 @@ void MScanListItem::serializeTo( QDataStream& s ) const
s << _type;
- s << (Q_UINT8) _wep;
+ s << (Q_UINT8) ( _wep ? 'y' : 'n' );
}
@@ -283,6 +283,8 @@ void MScanListItem::serializeFrom( QDataStream& s )
OListViewItem::serializeFrom( s );
+ char wep;
s >> _type;
- s >> (Q_UINT8) _wep;
+ s >> (Q_UINT8) wep;
+ _wep = (wep == 'y');
QString name;
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 8d18f73..8c2c315 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -115,11 +115,20 @@ void Wellenreiter::receivePacket(OPacket* p)
// check if we received a beacon frame
OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) );
- if ( beacon )
+ if ( beacon && beacon->managementType() == "Beacon" )
{
QString type;
if ( beacon->canIBSS() )
+ {
type = "adhoc";
- else
+ }
+ else if ( beacon->canESS() )
+ {
type = "managed";
+ }
+ else
+ {
+ qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) );
+ return;
+ }
OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
@@ -129,5 +138,5 @@ void Wellenreiter::receivePacket(OPacket* p)
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
- netView()->addNewItem( type, essid, header->macAddress2().toString(), header->usesWep(), channel, 0 );
+ netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 );
return;
}