Skip to content

Commit

Permalink
Add NULL check.
Browse files Browse the repository at this point in the history
The table could be deleted in the delete path, check for the same.

Change-Id: Id5d81a4c713d4063ad239920f031acbd19b23fa1
closes-bug: 1523854
  • Loading branch information
haripk committed Mar 14, 2016
1 parent f448583 commit 79f7ac9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/vnsw/agent/oper/vm_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3235,6 +3235,8 @@ void VmInterface::DeleteL2InterfaceRoute(bool old_bridging, VrfEntry *old_vrf,

EvpnAgentRouteTable *table = static_cast<EvpnAgentRouteTable *>
(old_vrf->GetEvpnRouteTable());
if (table == NULL)
return;
table->DelLocalVmRoute(peer_.get(), old_vrf->GetName(), mac,
this, old_v4_addr,
old_ethernet_tag);
Expand Down Expand Up @@ -3685,9 +3687,11 @@ void VmInterface::FloatingIp::L2DeActivate(VmInterface *interface,

EvpnAgentRouteTable *evpn_table = static_cast<EvpnAgentRouteTable *>
(vrf_->GetEvpnRouteTable());
evpn_table->DelLocalVmRoute(interface->peer_.get(), vrf_->GetName(),
MacAddress::FromString(interface->vm_mac()),
interface, floating_ip_, ethernet_tag);
if (evpn_table) {
evpn_table->DelLocalVmRoute(interface->peer_.get(), vrf_->GetName(),
MacAddress::FromString(interface->vm_mac()),
interface, floating_ip_, ethernet_tag);
}
//Reset the interface ethernet_tag
l2_installed_ = false;
}
Expand Down Expand Up @@ -4347,10 +4351,10 @@ void VmInterface::ServiceVlanRouteDel(const ServiceVlan &entry) {
// Delete the L2 Recive routes added for smac_ and dmac_
BridgeAgentRouteTable *table = static_cast<BridgeAgentRouteTable *>
(entry.vrf_->GetBridgeRouteTable());
table->Delete(peer_.get(), entry.vrf_->GetName(), entry.dmac_,
0);
table->Delete(peer_.get(), entry.vrf_->GetName(), entry.smac_,
0);
if (table) {
table->Delete(peer_.get(), entry.vrf_->GetName(), entry.dmac_, 0);
table->Delete(peer_.get(), entry.vrf_->GetName(), entry.smac_, 0);
}
entry.installed_ = false;
return;
}
Expand Down

0 comments on commit 79f7ac9

Please sign in to comment.