Bug 1727 - Ping6 should use a proper source address

This commit is contained in:
Peter D. Barnes, Jr.
2013-07-02 21:56:54 +02:00
parent 3e7b4c0636
commit 9a9dfcd1ad
2 changed files with 12 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ Bugs fixed
- Bug 1718 - Ipv4StaticRouting log component is misspelled
- Bug 1719 - IPv6 default state is set to not forward packets
- Bug 1720 - IPv6 Fragmentation cause crashes
- Bug 1727 - Ping6 should use a proper source address
Known issues
------------

View File

@@ -171,8 +171,17 @@ void Ping6::Send ()
/* hack to have ifIndex in Ipv6RawSocketImpl
* maybe add a SetIfIndex in Ipv6RawSocketImpl directly
*/
src = GetNode ()->GetObject<Ipv6> ()->GetAddress (m_ifIndex, 0).GetAddress ();
}
Ipv6InterfaceAddress dstIa (m_peerAddress);
for (uint32_t i = 0; i < GetNode ()->GetObject<Ipv6> ()->GetNAddresses (m_ifIndex); i++)
{
src = GetNode ()->GetObject<Ipv6> ()->GetAddress (m_ifIndex, i).GetAddress ();
Ipv6InterfaceAddress srcIa (src);
if ( srcIa.GetScope() == dstIa.GetScope() )
{
break;
}
}
}
else
{
src = m_localAddress;