senf/Packets/80211Bundle/WLANPacket: fixed bug in set method for sequence number...
cni [Wed, 10 Feb 2010 14:03:09 +0000 (14:03 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1576 270642c3-0616-0410-b53a-bc976706d245

senf/Packets/80211Bundle/WLANPacket.cc
senf/Packets/80211Bundle/WLANPacket.test.cc

index c4e9c67..5e9fd03 100644 (file)
@@ -57,8 +57,8 @@ namespace {
 
 prefix_ void senf::WLANPacket_MgtFrameParser::sequenceNumber(boost::uint16_t sn)
 {
-    seqNumber_2() = seqNumber_2() | (sn >> 4 ) ;
-    seqNumber_1() = seqNumber_1() | sn;
+    seqNumber_2() = 0u | (sn >> 4 ) ;
+    seqNumber_1() = 0u | sn;
 }
 
 prefix_ void senf::WLANPacket_MgtFrameType::dump(packet p, std::ostream &os)
@@ -85,8 +85,8 @@ prefix_ void senf::WLANPacket_CtrlFrameType::dump(packet p, std::ostream &os)
 
 prefix_ void senf::WLANPacket_DataFrameParser::sequenceNumber(boost::uint16_t sn)
 {
-    seqNumber_2() = seqNumber_2() | (sn >> 4 ) ;
-    seqNumber_1() = seqNumber_1() | sn;
+    seqNumber_2() = 0u | (sn >> 4 ) ;
+    seqNumber_1() = 0u | sn;
 }
 
 
index a47a1a9..c59427e 100644 (file)
@@ -160,13 +160,12 @@ SENF_AUTO_UNIT_TEST(WLANPacket_mgtFrame_create)
             p->bssid() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c")
     );
     SENF_CHECK_NO_THROW(
-            p->sequenceNumber(555u);
+            p->sequenceNumber(2);
+            p->sequenceNumber(p->sequenceNumber()+1);
     );
-    
 
-    std::cout << p->sequenceNumber() << "\n";
     BOOST_CHECK_EQUAL( p->type(), 0u );
-    BOOST_CHECK_EQUAL( p->sequenceNumber(), 555u );
+    BOOST_CHECK_EQUAL( p->sequenceNumber(), 3u );
 }