do not use output address parameter (possibly uninitialized) before assignment

This commit is contained in:
Tom Henderson
2015-12-15 23:30:52 -08:00
parent c59aea3b31
commit 491afdbe23

View File

@@ -474,7 +474,7 @@ PacketSocket::GetSockName (Address &address) const
ad.SetProtocol (m_protocol);
if (m_isSingleDevice)
{
Ptr<NetDevice> device = m_node->GetDevice (ad.GetSingleDevice ());
Ptr<NetDevice> device = m_node->GetDevice (m_device);
ad.SetPhysicalAddress (device->GetAddress ());
ad.SetSingleDevice (m_device);
}