dsr: Avoid possible segmentation fault in DsrRouting::DoDispose
This commit is contained in:
@@ -557,12 +557,16 @@ DsrRouting::DoDispose (void)
|
||||
Ptr<WifiNetDevice> wifi = dev->GetObject<WifiNetDevice> ();
|
||||
if (wifi != 0)
|
||||
{
|
||||
Ptr<WifiMac> mac = wifi->GetMac ()->GetObject<AdhocWifiMac> ();
|
||||
Ptr<WifiMac> mac = wifi->GetMac ();
|
||||
if (mac != 0)
|
||||
{
|
||||
mac->TraceDisconnectWithoutContext ("TxErrHeader",
|
||||
Ptr<AdhocWifiMac> adhoc = mac->GetObject<AdhocWifiMac> ();
|
||||
if (adhoc)
|
||||
{
|
||||
adhoc->TraceDisconnectWithoutContext ("TxErrHeader",
|
||||
m_routeCache->GetTxErrorCallback ());
|
||||
m_routeCache->DelArpCache (m_ipv4->GetInterface (i)->GetArpCache ());
|
||||
m_routeCache->DelArpCache (m_ipv4->GetInterface (i)->GetArpCache ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user