bug 592: Ipv4RoutingProtocol::RouteOutput needs a packet pointer argument for reactive protocols
This commit is contained in:
1 parent
42f742dfb5
commit
278f186830
16 files changed
+26
-24
No files matched your search
@@ -318,7 +318,8 @@ ArpL3Protocol::SendArpRequest (Ptr<const ArpCache> cache, Ipv4Address to)
|
||||
Ipv4Header header;
|
||||
header.SetDestination (to);
|
||||
Socket::SocketErrno errno_;
|
||||
Ptr<Ipv4Route> route = ipv4->GetRoutingProtocol ()->RouteOutput (header, interface, errno_);
|
||||
Ptr<Packet> packet = Create<Packet> ();
|
||||
Ptr<Ipv4Route> route = ipv4->GetRoutingProtocol ()->RouteOutput (packet, header, interface, errno_);
|
||||
NS_ASSERT (route != 0);
|
||||
NS_LOG_LOGIC ("ARP: sending request from node "<<m_node->GetId ()<<
|
||||
" || src: " << cache->GetDevice ()->GetAddress () <<
|
||||
@@ -329,7 +330,6 @@ ArpL3Protocol::SendArpRequest (Ptr<const ArpCache> cache, Ipv4Address to)
|
||||
route->GetSource (),
|
||||
cache->GetDevice ()->GetBroadcast (),
|
||||
to);
|
||||
Ptr<Packet> packet = Create<Packet> ();
|
||||
packet->AddHeader (arp);
|
||||
cache->GetDevice ()->Send (packet, cache->GetDevice ()->GetBroadcast (), PROT_NUMBER);
|
||||
}
|
||||
@@ -346,7 +346,8 @@ ArpL3Protocol::SendArpReply (Ptr<const ArpCache> cache, Ipv4Address toIp, Addres
|
||||
Ipv4Header header;
|
||||
header.SetDestination (toIp);
|
||||
Socket::SocketErrno errno_;
|
||||
Ptr<Ipv4Route> route = ipv4->GetRoutingProtocol ()->RouteOutput (header, interface, errno_);
|
||||
Ptr<Packet> packet = Create<Packet> ();
|
||||
Ptr<Ipv4Route> route = ipv4->GetRoutingProtocol ()->RouteOutput (packet, header, interface, errno_);
|
||||
NS_ASSERT (route != 0);
|
||||
NS_LOG_LOGIC ("ARP: sending reply from node "<<m_node->GetId ()<<
|
||||
"|| src: " << cache->GetDevice ()->GetAddress () <<
|
||||
@@ -354,7 +355,6 @@ ArpL3Protocol::SendArpReply (Ptr<const ArpCache> cache, Ipv4Address toIp, Addres
|
||||
" || dst: " << toMac << " / " << toIp);
|
||||
arp.SetReply (cache->GetDevice ()->GetAddress (),
|
||||
route->GetSource (), toMac, toIp);
|
||||
Ptr<Packet> packet = Create<Packet> ();
|
||||
packet->AddHeader (arp);
|
||||
cache->GetDevice ()->Send (packet, toMac, PROT_NUMBER);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ Icmpv4L4Protocol::SendMessage (Ptr<Packet> packet, Ipv4Address dest, uint8_t typ
|
||||
Socket::SocketErrno errno_;
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (packet, header, oif, errno_);
|
||||
if (route != 0)
|
||||
{
|
||||
NS_LOG_LOGIC ("Route exists");
|
||||
|
||||
@@ -532,7 +532,7 @@ Ipv4L3Protocol::Send (Ptr<Packet> packet,
|
||||
Socket::SocketErrno errno_;
|
||||
uint32_t oif = 0; // unused for now
|
||||
ipHeader = BuildHeader (source, destination, protocol, packet->GetSize (), ttl, mayFragment);
|
||||
Ptr<Ipv4Route> newRoute = m_routingProtocol->RouteOutput (ipHeader, oif, errno_);
|
||||
Ptr<Ipv4Route> newRoute = m_routingProtocol->RouteOutput (packet, ipHeader, oif, errno_);
|
||||
if (newRoute)
|
||||
{
|
||||
SendRealOut (newRoute, packet, ipHeader);
|
||||
|
||||
@@ -178,7 +178,7 @@ Ipv4RawSocketImpl::SendTo (Ptr<Packet> p, uint32_t flags,
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
// TBD-- we could cache the route and just check its validity
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (p, header, oif, errno_);
|
||||
if (route != 0)
|
||||
{
|
||||
NS_LOG_LOGIC ("Route exists");
|
||||
|
||||
@@ -547,7 +547,7 @@ TcpL4Protocol::Send (Ptr<Packet> packet,
|
||||
Socket::SocketErrno errno_;
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (packet, header, oif, errno_);
|
||||
ipv4->Send (packet, saddr, daddr, PROT_NUMBER, route);
|
||||
}
|
||||
}
|
||||
@@ -585,7 +585,7 @@ TcpL4Protocol::SendPacket (Ptr<Packet> packet, TcpHeader outgoingHeader,
|
||||
Socket::SocketErrno errno_;
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (packet, header, oif, errno_);
|
||||
ipv4->Send (packet, saddr, daddr, PROT_NUMBER, route);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -354,7 +354,7 @@ TcpSocketImpl::Connect (const Address & address)
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
// XXX here, cache the route in the endpoint?
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (Ptr<Packet> (), header, oif, errno_);
|
||||
if (route != 0)
|
||||
{
|
||||
NS_LOG_LOGIC ("Route exists");
|
||||
@@ -855,7 +855,7 @@ bool TcpSocketImpl::ProcessPacketAction (Actions_t a, Ptr<Packet> p,
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
header.SetDestination (m_remoteAddress);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (Ptr<Packet> (), header, oif, errno_);
|
||||
if (route != 0)
|
||||
{
|
||||
NS_LOG_LOGIC ("Route exists");
|
||||
|
||||
@@ -400,7 +400,7 @@ UdpSocketImpl::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
||||
Ptr<Ipv4Route> route;
|
||||
uint32_t oif = 0; //specify non-zero if bound to a source address
|
||||
// TBD-- we could cache the route and just check its validity
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (header, oif, errno_);
|
||||
route = ipv4->GetRoutingProtocol ()->RouteOutput (p, header, oif, errno_);
|
||||
if (route != 0)
|
||||
{
|
||||
NS_LOG_LOGIC ("Route exists");
|
||||
|
||||
Reference in new issue
Block a user