Bug 2083 - BridgeNetDevice may send corrupted packets
authorTommaso Pecorella <tommaso.pecorella@unifi.it>
Wed, 25 Mar 2015 16:55:18 +0100
changeset 11237 77e2228781ac
parent 11236 6ea11eb86c17
child 11238 96b5da288844
Bug 2083 - BridgeNetDevice may send corrupted packets
RELEASE_NOTES
examples/wireless/wifi-wired-bridging.cc
src/bridge/model/bridge-net-device.cc
--- a/RELEASE_NOTES	Thu Mar 19 21:13:16 2015 +0100
+++ b/RELEASE_NOTES	Wed Mar 25 16:55:18 2015 +0100
@@ -34,6 +34,7 @@
 - Bug 2076 - TCP MinRTO Attribute is not actually used
 - Bug 2077 - Icmpv6L4Protocol::HandleDestinationUnreachable must check the packet size, not its serialized size
 - Bug 2079 - mcs variable in ht-wifi-network example is confusing
+- Bug 2083 - BridgeNetDevice may send corrupted packets
 
 Known issues
 ------------
--- a/examples/wireless/wifi-wired-bridging.cc	Thu Mar 19 21:13:16 2015 +0100
+++ b/examples/wireless/wifi-wired-bridging.cc	Wed Mar 25 16:55:18 2015 +0100
@@ -24,7 +24,7 @@
 //      +-----+      +-----+            +-----+      +-----+
 //      | STA |      | STA |            | STA |      | STA | 
 //      +-----+      +-----+            +-----+      +-----+
-//    192.168.0.3  192.168.0.4        192.168.0.5  192.168.0.6
+//    192.168.0.2  192.168.0.3        192.168.0.5  192.168.0.6
 //      --------     --------           --------     --------
 //      WIFI STA     WIFI STA           WIFI STA     WIFI STA
 //      --------     --------           --------     --------
@@ -37,7 +37,7 @@
 //             ##############           ##############
 //                 BRIDGE                   BRIDGE
 //             ##############           ############## 
-//               192.168.0.1              192.168.0.2
+//               192.168.0.1              192.168.0.4
 //               +---------+              +---------+
 //               | AP Node |              | AP Node |
 //               +---------+              +---------+
--- a/src/bridge/model/bridge-net-device.cc	Thu Mar 19 21:13:16 2015 +0100
+++ b/src/bridge/model/bridge-net-device.cc	Wed Mar 25 16:55:18 2015 +0100
@@ -398,11 +398,13 @@
 
   // data was not unicast or no state has been learned for that mac
   // address => flood through all ports.
+  Ptr<Packet> pktCopy;
   for (std::vector< Ptr<NetDevice> >::iterator iter = m_ports.begin ();
        iter != m_ports.end (); iter++)
     {
+      pktCopy = packet->Copy ();
       Ptr<NetDevice> port = *iter;
-      port->SendFrom (packet, src, dest, protocolNumber);
+      port->SendFrom (pktCopy, src, dest, protocolNumber);
     }
 
   return true;