Bug 1796 - Ipv6PacketInfoTag is not filled by UdpSocketImpl::ForwardUp6.
This commit is contained in:
@@ -111,6 +111,9 @@ us a note on ns-developers mailing list.</p>
|
||||
|
||||
<h2>Changes to existing API:</h2>
|
||||
<ul>
|
||||
<li> It is now possible to use Ipv6PacketInfoTag from UDP applications in the
|
||||
very same way as Ipv4PacketInfoTag. See Doxygen fo current limitations in
|
||||
using Ipv[4,6]PacketInfoTag to set IP properties.</li>
|
||||
<li> A change in Ipv[4,6]Interface enforces the correct behaviour of IP
|
||||
when a device do not support the minimum MTU requirements.
|
||||
This is set to 68 and 1280 octects respectively.
|
||||
|
||||
@@ -21,6 +21,10 @@ Supported platforms
|
||||
|
||||
New user-visible features
|
||||
-------------------------
|
||||
- It is now possible to use Ipv6PacketInfoTag from UDP applications in the
|
||||
very same way as Ipv4PacketInfoTag. See Doxygen fo current limitations in
|
||||
using Ipv[4,6]PacketInfoTag to set IP properties.
|
||||
|
||||
- Ipv[4,6]Interfaces not respecting the minimum MTU requirements (68 octects
|
||||
for IPv4 and 1280 octects for IPv6) will be automatically set as Down.
|
||||
Warning: this might break some simulations (which hadn't to work anyway).
|
||||
@@ -79,6 +83,7 @@ Bugs fixed
|
||||
- Bug 1776 - Improve CRC performance for CsmaNetDevice in emulation modes
|
||||
- Bug 1788 - unused private field warning
|
||||
- Bug 1789 - missing test condition for sigma in buildings-shadowing-test
|
||||
- Bug 1796 - Ipv6PacketInfoTag is not filled by UdpSocketImpl::ForwardUp6
|
||||
- Bug 1798 - Changing the rate of onOffApplication might stop transmission
|
||||
- Bug 1802 - FlowMon header deserialization problem with IPv4 fragments
|
||||
- Bug 1803 - Lookup /NodeList/4/DeviceList/0/LteEnbRrc/UeMap/0 got no matches
|
||||
|
||||
@@ -96,7 +96,7 @@ void Ipv6EndPoint::SetPeer (Ipv6Address addr, uint16_t port)
|
||||
m_peerPort = port;
|
||||
}
|
||||
|
||||
void Ipv6EndPoint::SetRxCallback (Callback<void, Ptr<Packet>, Ipv6Header, uint16_t> callback)
|
||||
void Ipv6EndPoint::SetRxCallback (Callback<void, Ptr<Packet>, Ipv6Header, uint16_t, Ptr<Ipv6Interface> > callback)
|
||||
{
|
||||
m_rxCallback = callback;
|
||||
}
|
||||
@@ -111,11 +111,12 @@ void Ipv6EndPoint::SetDestroyCallback (Callback<void> callback)
|
||||
m_destroyCallback = callback;
|
||||
}
|
||||
|
||||
void Ipv6EndPoint::ForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t port)
|
||||
void Ipv6EndPoint::ForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface)
|
||||
{
|
||||
if (!m_rxCallback.IsNull ())
|
||||
{
|
||||
m_rxCallback (p, header, port);
|
||||
Simulator::ScheduleNow (&Ipv6EndPoint::DoForwardUp, this, p, header, port,
|
||||
incomingInterface);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,9 +130,9 @@ void Ipv6EndPoint::ForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
|
||||
}
|
||||
}
|
||||
|
||||
void Ipv6EndPoint::DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport)
|
||||
void Ipv6EndPoint::DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport, Ptr<Ipv6Interface> incomingInterface)
|
||||
{
|
||||
m_rxCallback (p, header, sport);
|
||||
m_rxCallback (p, header, sport, incomingInterface);
|
||||
}
|
||||
|
||||
void Ipv6EndPoint::DoForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "ns3/callback.h"
|
||||
#include "ns3/ipv6-header.h"
|
||||
#include "ns3/net-device.h"
|
||||
#include "ns3/ipv6-interface.h"
|
||||
|
||||
namespace ns3
|
||||
{
|
||||
@@ -134,7 +135,7 @@ public:
|
||||
* \brief Set the reception callback.
|
||||
* \param callback callback function
|
||||
*/
|
||||
void SetRxCallback (Callback<void, Ptr<Packet>, Ipv6Header, uint16_t> callback);
|
||||
void SetRxCallback (Callback<void, Ptr<Packet>, Ipv6Header, uint16_t, Ptr<Ipv6Interface> > callback);
|
||||
|
||||
/**
|
||||
* \brief Set the ICMP callback.
|
||||
@@ -157,8 +158,9 @@ public:
|
||||
* \param p the packet
|
||||
* \param header the packet header
|
||||
* \param port source port
|
||||
* \param incomingInterface incoming interface
|
||||
*/
|
||||
void ForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t port);
|
||||
void ForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface);
|
||||
|
||||
/**
|
||||
* \brief Forward the ICMP packet to the upper level.
|
||||
@@ -181,8 +183,9 @@ private:
|
||||
* \param p packet
|
||||
* \param header the packet header
|
||||
* \param sport source port
|
||||
* \param incomingInterface incoming interface
|
||||
*/
|
||||
void DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport);
|
||||
void DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport, Ptr<Ipv6Interface> incomingInterface);
|
||||
|
||||
/**
|
||||
* \brief ForwardIcmp wrapper.
|
||||
@@ -223,7 +226,7 @@ private:
|
||||
/**
|
||||
* \brief The RX callback.
|
||||
*/
|
||||
Callback<void, Ptr<Packet>, Ipv6Header, uint16_t> m_rxCallback;
|
||||
Callback<void, Ptr<Packet>, Ipv6Header, uint16_t, Ptr<Ipv6Interface> > m_rxCallback;
|
||||
|
||||
/**
|
||||
* \brief The ICMPv6 callback.
|
||||
|
||||
@@ -507,7 +507,7 @@ TcpL4Protocol::Receive (Ptr<Packet> packet,
|
||||
}
|
||||
NS_ASSERT_MSG (endPoints.size () == 1, "Demux returned more than one endpoint");
|
||||
NS_LOG_LOGIC ("TcpL4Protocol "<<this<<" forwarding up to endpoint/socket");
|
||||
(*endPoints.begin ())->ForwardUp (packet, ipHeader, tcpHeader.GetSourcePort ());
|
||||
(*endPoints.begin ())->ForwardUp (packet, ipHeader, tcpHeader.GetSourcePort (), interface);
|
||||
return IpL4Protocol::RX_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -811,7 +811,7 @@ TcpSocketBase::ForwardUp (Ptr<Packet> packet, Ipv4Header header, uint16_t port,
|
||||
}
|
||||
|
||||
void
|
||||
TcpSocketBase::ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port)
|
||||
TcpSocketBase::ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface)
|
||||
{
|
||||
DoForwardUp (packet, header, port);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ns3/ipv4-header.h"
|
||||
#include "ns3/ipv4-interface.h"
|
||||
#include "ns3/ipv6-header.h"
|
||||
#include "ns3/ipv6-interface.h"
|
||||
#include "ns3/event-id.h"
|
||||
#include "tcp-tx-buffer.h"
|
||||
#include "tcp-rx-buffer.h"
|
||||
@@ -221,8 +222,9 @@ protected:
|
||||
* \param packet the incoming packet
|
||||
* \param header the packet's IPv6 header
|
||||
* \param port the incoming port
|
||||
* \param incomingInterface the incoming interface
|
||||
*/
|
||||
void ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port);
|
||||
void ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface);
|
||||
|
||||
/**
|
||||
* \brief Called by TcpSocketBase::ForwardUp().
|
||||
|
||||
@@ -403,7 +403,7 @@ UdpL4Protocol::Receive (Ptr<Packet> packet,
|
||||
for (Ipv6EndPointDemux::EndPointsI endPoint = endPoints.begin ();
|
||||
endPoint != endPoints.end (); endPoint++)
|
||||
{
|
||||
(*endPoint)->ForwardUp (packet->Copy (), header, udpHeader.GetSourcePort ());
|
||||
(*endPoint)->ForwardUp (packet->Copy (), header, udpHeader.GetSourcePort (), interface);
|
||||
}
|
||||
return IpL4Protocol::RX_OK;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "ns3/udp-socket-factory.h"
|
||||
#include "ns3/trace-source-accessor.h"
|
||||
#include "ns3/ipv4-packet-info-tag.h"
|
||||
#include "ns3/ipv6-packet-info-tag.h"
|
||||
#include "udp-socket-impl.h"
|
||||
#include "udp-l4-protocol.h"
|
||||
#include "ipv4-end-point.h"
|
||||
@@ -965,7 +966,7 @@ UdpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Header header, uint16_t port,
|
||||
}
|
||||
|
||||
void
|
||||
UdpSocketImpl::ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port)
|
||||
UdpSocketImpl::ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << packet << header.GetSourceAddress () << port);
|
||||
|
||||
@@ -974,6 +975,14 @@ UdpSocketImpl::ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port)
|
||||
return;
|
||||
}
|
||||
|
||||
// Should check via getsockopt ()..
|
||||
if (IsRecvPktInfo ())
|
||||
{
|
||||
Ipv6PacketInfoTag tag;
|
||||
packet->RemovePacketTag (tag);
|
||||
tag.SetRecvIf (incomingInterface->GetDevice ()->GetIfIndex ());
|
||||
packet->AddPacketTag (tag);
|
||||
}
|
||||
|
||||
//Check only version 6 options
|
||||
if (IsIpv6RecvTclass ())
|
||||
|
||||
@@ -136,8 +136,9 @@ private:
|
||||
* \param packet the incoming packet
|
||||
* \param header the packet's IPv6 header
|
||||
* \param port the incoming port
|
||||
* \param incomingInterface the incoming interface
|
||||
*/
|
||||
void ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port);
|
||||
void ForwardUp6 (Ptr<Packet> packet, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface);
|
||||
|
||||
/**
|
||||
* \brief Kill this socket by zeroing its attributes (IPv4)
|
||||
|
||||
Reference in New Issue
Block a user