merge with HEAD
This commit is contained in:
@@ -108,6 +108,11 @@ ArpL3Protocol::Receive(Ptr<NetDevice> device, Ptr<Packet> packet, uint16_t proto
|
||||
arp.GetDestinationIpv4Address () << "; we have address " <<
|
||||
cache->GetInterface ()->GetAddress ());
|
||||
|
||||
/**
|
||||
* Note: we do not update the ARP cache when we receive an ARP request
|
||||
* from an unknown node. See bug #107
|
||||
*/
|
||||
|
||||
if (arp.IsRequest () &&
|
||||
arp.GetDestinationIpv4Address () == cache->GetInterface ()->GetAddress ())
|
||||
{
|
||||
|
||||
@@ -681,6 +681,7 @@ bool TcpSocket::ProcessPacketAction (Actions_t a, Ptr<Packet> p,
|
||||
// TCP SYN consumes one byte
|
||||
m_nextRxSequence = tcpHeader.GetSequenceNumber() + SequenceNumber(1);
|
||||
m_nextTxSequence = tcpHeader.GetAckNumber ();
|
||||
m_firstPendingSequence = m_nextTxSequence; //bug 166
|
||||
NS_LOG_DEBUG ("TcpSocket " << this << " ACK_TX_1" <<
|
||||
" nextRxSeq " << m_nextRxSequence);
|
||||
SendEmptyPacket (TcpHeader::ACK);
|
||||
|
||||
@@ -295,14 +295,15 @@ UdpSocket::DoSendTo (Ptr<Packet> p, Ipv4Address dest, uint16_t port)
|
||||
NotifyDataSent (p->GetSize ());
|
||||
}
|
||||
NS_LOG_LOGIC ("Limited broadcast end.");
|
||||
return p->GetSize();
|
||||
}
|
||||
else if (ipv4->GetIfIndexForDestination(dest, localIfIndex))
|
||||
{
|
||||
NS_LOG_LOGIC ("Route exists");
|
||||
m_udp->Send (p, ipv4->GetAddress (localIfIndex), dest,
|
||||
m_udp->Send (p->Copy (), ipv4->GetAddress (localIfIndex), dest,
|
||||
m_endPoint->GetLocalPort (), port);
|
||||
NotifyDataSent (p->GetSize ());
|
||||
return 0;
|
||||
return p->GetSize();;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -471,7 +472,7 @@ UdpSocketTest::RunTests (void)
|
||||
m_receivedPacket = Create<Packet> ();
|
||||
m_receivedPacket2 = Create<Packet> ();
|
||||
NS_TEST_ASSERT_EQUAL (txSocket->SendTo (InetSocketAddress (Ipv4Address("10.0.0.1"), 1234),
|
||||
Create<Packet> (123)), 0);
|
||||
Create<Packet> (123)), 123);
|
||||
Simulator::Run ();
|
||||
NS_TEST_ASSERT_EQUAL (m_receivedPacket->GetSize (), 123);
|
||||
NS_TEST_ASSERT_EQUAL (m_receivedPacket2->GetSize (), 0); // second interface should receive it
|
||||
@@ -482,7 +483,7 @@ UdpSocketTest::RunTests (void)
|
||||
m_receivedPacket = Create<Packet> ();
|
||||
m_receivedPacket2 = Create<Packet> ();
|
||||
NS_TEST_ASSERT_EQUAL (txSocket->SendTo (InetSocketAddress (Ipv4Address("255.255.255.255"), 1234),
|
||||
Create<Packet> (123)), 0);
|
||||
Create<Packet> (123)), 123);
|
||||
Simulator::Run ();
|
||||
NS_TEST_ASSERT_EQUAL (m_receivedPacket->GetSize (), 123);
|
||||
// second socket should not receive it (it is bound specifically to the second interface's address
|
||||
@@ -502,7 +503,7 @@ UdpSocketTest::RunTests (void)
|
||||
m_receivedPacket = Create<Packet> ();
|
||||
m_receivedPacket2 = Create<Packet> ();
|
||||
NS_TEST_ASSERT_EQUAL (txSocket->SendTo (InetSocketAddress (Ipv4Address("255.255.255.255"), 1234),
|
||||
Create<Packet> (123)), 0);
|
||||
Create<Packet> (123)), 123);
|
||||
Simulator::Run ();
|
||||
NS_TEST_ASSERT_EQUAL (m_receivedPacket->GetSize (), 123);
|
||||
NS_TEST_ASSERT_EQUAL (m_receivedPacket2->GetSize (), 123);
|
||||
|
||||
Reference in New Issue
Block a user