Minor tweak to stats example.
--- a/examples/stats/wifi-example-apps.cc Wed Jun 24 10:43:52 2009 -0400
+++ b/examples/stats/wifi-example-apps.cc Wed Jun 24 10:57:52 2009 -0400
@@ -250,11 +250,14 @@
}
TimestampTag timestamp;
- packet->FindFirstMatchingByteTag(timestamp);
- Time tx = timestamp.GetTimestamp();
+ // Should never not be found since the sender is adding it, but
+ // you never know.
+ if (packet->FindFirstMatchingByteTag(timestamp)) {
+ Time tx = timestamp.GetTimestamp();
- if (m_delay != 0) {
- m_delay->Update(Simulator::Now() - tx);
+ if (m_delay != 0) {
+ m_delay->Update(Simulator::Now() - tx);
+ }
}
if (m_calc != 0) {