From 9279f1b604d055d0316916bade51eb77724b8921 Mon Sep 17 00:00:00 2001 From: Hari Date: Thu, 2 Jun 2016 11:12:40 +0530 Subject: [PATCH] Ignore event when state is not set. When interface is not notified yet, path preference events seen before state is present can be ignored. Change-Id: I15eee0ffa16acb6ffb7f9737e425c29c5d7f0dcd closes-bug: #1586143 --- src/vnsw/agent/oper/path_preference.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vnsw/agent/oper/path_preference.cc b/src/vnsw/agent/oper/path_preference.cc index dbb688596cd..bb33739c7d9 100644 --- a/src/vnsw/agent/oper/path_preference.cc +++ b/src/vnsw/agent/oper/path_preference.cc @@ -809,6 +809,10 @@ bool PathPreferenceModule::DequeueEvent(PathPreferenceEventContainer event) { const PathPreferenceIntfState *cintf_state = static_cast( vm_intf->GetState(agent_->interface_table(), intf_id_)); + if (!cintf_state) { + return true; + } + PathPreferenceIntfState *intf_state = const_cast(cintf_state); /* Only events with IPv4 IP is enqueued now */ @@ -887,9 +891,11 @@ void PathPreferenceModule::VrfNotify(DBTablePartBase *partition, static_cast(e->GetState(partition->parent(), vrf_id_)); - if (vrf->IsDeleted() && vrf_state) { - e->ClearState(partition->parent(), vrf_id_); - delete vrf_state; + if (vrf->IsDeleted()) { + if (vrf_state) { + e->ClearState(partition->parent(), vrf_id_); + delete vrf_state; + } return; }