Bug 1727 - Ping6 should use a proper source address
This commit is contained in:
@@ -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
|
||||
------------
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user