Bug 1858 - wireless examples not correctly recording packet reception - reported by Scott Carpenter <scarpen_at_ncsu.edu>
--- a/RELEASE_NOTES Wed Sep 10 06:15:01 2014 +0200
+++ b/RELEASE_NOTES Wed Sep 10 08:27:26 2014 +0200
@@ -55,6 +55,7 @@
- Bug 1831 - TcpSocket SlowStartThreshold is not a TraceSource
- Bug 1851 - WifiRadioEnergyModel energy consumption values are taken from a 802.15.4 chip
- Bug 1854 - std::out_of_range Problem
+- Bug 1858 - wireless examples not correctly recording packet reception
- Bug 1860 - TCP needs the Window Scale option
- Bug 1893 - issue in DoSchedUlTriggerReq with harq
- Bug 1921 - Icmpv6L4Protocol::ForgeEchoRequest returns a malformed packet
--- a/examples/wireless/wifi-simple-adhoc-grid.cc Wed Sep 10 06:15:01 2014 +0200
+++ b/examples/wireless/wifi-simple-adhoc-grid.cc Wed Sep 10 08:27:26 2014 +0200
@@ -90,7 +90,10 @@
void ReceivePacket (Ptr<Socket> socket)
{
- NS_LOG_UNCOND ("Received one packet!");
+ while (socket->Recv ())
+ {
+ NS_LOG_UNCOND ("Received one packet!");
+ }
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
--- a/examples/wireless/wifi-simple-adhoc.cc Wed Sep 10 06:15:01 2014 +0200
+++ b/examples/wireless/wifi-simple-adhoc.cc Wed Sep 10 08:27:26 2014 +0200
@@ -69,7 +69,10 @@
void ReceivePacket (Ptr<Socket> socket)
{
- NS_LOG_UNCOND ("Received one packet!");
+ while (socket->Recv ())
+ {
+ NS_LOG_UNCOND ("Received one packet!");
+ }
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
--- a/examples/wireless/wifi-simple-infra.cc Wed Sep 10 06:15:01 2014 +0200
+++ b/examples/wireless/wifi-simple-infra.cc Wed Sep 10 08:27:26 2014 +0200
@@ -70,7 +70,10 @@
void ReceivePacket (Ptr<Socket> socket)
{
- NS_LOG_UNCOND ("Received one packet!");
+ while (socket->Recv ())
+ {
+ NS_LOG_UNCOND ("Received one packet!");
+ }
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,
--- a/examples/wireless/wifi-simple-interference.cc Wed Sep 10 06:15:01 2014 +0200
+++ b/examples/wireless/wifi-simple-interference.cc Wed Sep 10 08:27:26 2014 +0200
@@ -99,11 +99,16 @@
static inline std::string PrintReceivedPacket (Ptr<Socket> socket)
{
Address addr;
- socket->GetSockName (addr);
- InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
std::ostringstream oss;
- oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ();
+
+ while (socket->Recv ())
+ {
+ socket->GetSockName (addr);
+ InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (addr);
+
+ oss << "Received one packet! Socket: " << iaddr.GetIpv4 () << " port: " << iaddr.GetPort ();
+ }
return oss.str ();
}
--- a/src/wave/examples/wave-simple-80211p.cc Wed Sep 10 06:15:01 2014 +0200
+++ b/src/wave/examples/wave-simple-80211p.cc Wed Sep 10 08:27:26 2014 +0200
@@ -75,7 +75,10 @@
void ReceivePacket (Ptr<Socket> socket)
{
- NS_LOG_UNCOND ("Received one packet!");
+ while (socket->Recv ())
+ {
+ NS_LOG_UNCOND ("Received one packet!");
+ }
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize,