Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple
--- a/RELEASE_NOTES Sun Jul 20 10:13:02 2014 +0200
+++ b/RELEASE_NOTES Sun Jul 20 11:29:28 2014 +0200
@@ -33,6 +33,7 @@
- Bug 1937 - FlowMonitor fails to track multiplexed packets
- Bug 1943 - Waveform generator signal duration calc error
- Bug 1951 - AODV does not update nexthop for 1-hop nodes
+- Bug 1955 - The IPv4 identification field should be unique per (source, destination, protocol) tuple
Known issues
------------
Binary file src/aodv/test/aodv-chain-regression-test-0-0.pcap has changed
Binary file src/aodv/test/aodv-chain-regression-test-1-0.pcap has changed
Binary file src/aodv/test/aodv-chain-regression-test-2-0.pcap has changed
Binary file src/aodv/test/aodv-chain-regression-test-3-0.pcap has changed
Binary file src/aodv/test/aodv-chain-regression-test-4-0.pcap has changed
Binary file src/aodv/test/bug-606-test-0-0.pcap has changed
Binary file src/aodv/test/bug-606-test-1-0.pcap has changed
Binary file src/aodv/test/bug-606-test-2-0.pcap has changed
Binary file src/aodv/test/tcp-chain-test-0-0.pcap has changed
Binary file src/aodv/test/tcp-chain-test-9-0.pcap has changed
Binary file src/aodv/test/udp-chain-test-0-0.pcap has changed
Binary file src/aodv/test/udp-chain-test-9-0.pcap has changed
--- a/src/internet/model/ipv4-l3-protocol.cc Sun Jul 20 10:13:02 2014 +0200
+++ b/src/internet/model/ipv4-l3-protocol.cc Sun Jul 20 11:29:28 2014 +0200
@@ -735,11 +735,17 @@
ipHeader.SetPayloadSize (payloadSize);
ipHeader.SetTtl (ttl);
ipHeader.SetTos (tos);
+
+ uint64_t src = source.Get ();
+ uint64_t dst = destination.Get ();
+ uint64_t srcDst = dst | (src << 32);
+ std::pair<uint64_t, uint8_t> key = std::make_pair (srcDst, protocol);
+
if (mayFragment == true)
{
ipHeader.SetMayFragment ();
- ipHeader.SetIdentification (m_identification[protocol]);
- m_identification[protocol]++;
+ ipHeader.SetIdentification (m_identification[key]);
+ m_identification[key]++;
}
else
{
@@ -748,8 +754,8 @@
// identification requirement:
// >> Originating sources MAY set the IPv4 ID field of atomic datagrams
// to any value.
- ipHeader.SetIdentification (m_identification[protocol]);
- m_identification[protocol]++;
+ ipHeader.SetIdentification (m_identification[key]);
+ m_identification[key]++;
}
if (Node::ChecksumEnabled ())
{
@@ -1524,5 +1530,4 @@
m_fragments.erase (key);
m_fragmentsTimers.erase (key);
}
-
} // namespace ns3
--- a/src/internet/model/ipv4-l3-protocol.h Sun Jul 20 10:13:02 2014 +0200
+++ b/src/internet/model/ipv4-l3-protocol.h Sun Jul 20 11:29:28 2014 +0200
@@ -388,7 +388,7 @@
* \param iif Input Interface
*/
void HandleFragmentsTimeout ( std::pair<uint64_t, uint32_t> key, Ipv4Header & ipHeader, uint32_t iif);
-
+
/**
* \brief Container of the IPv4 Interfaces.
*/
@@ -408,7 +408,7 @@
Ipv4InterfaceList m_interfaces; //!< List of IPv4 interfaces.
uint8_t m_defaultTos; //!< Default TOS
uint8_t m_defaultTtl; //!< Default TTL
- std::map<uint8_t, uint16_t> m_identification; //!< Identification (for each protocol)
+ std::map<std::pair<uint64_t, uint8_t>, uint16_t> m_identification; //!< Identification (for each {src, dst, proto} tuple)
Ptr<Node> m_node; //!< Node attached to stack.
/// Trace of sent packets
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-0-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-1-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-2-1.pcap has changed
Binary file src/mesh/test/dot11s/hwmp-target-flags-regression-test-3-1.pcap has changed