internet: Loopback IPv4 address should have HOST scope

This commit is contained in:
Christophe Delahaye
2020-10-15 15:37:34 +02:00
committed by Tom Henderson
parent ffd792bb7d
commit f1fe3d0faf

View File

@@ -39,6 +39,10 @@ Ipv4InterfaceAddress::Ipv4InterfaceAddress (Ipv4Address local, Ipv4Mask mask)
{
NS_LOG_FUNCTION (this << local << mask);
m_local = local;
if (m_local == Ipv4Address::GetLoopback ())
{
m_scope = HOST;
}
m_mask = mask;
m_broadcast = Ipv4Address (local.Get () | (~mask.Get ()));
}