Skip to content

Commit

Permalink
Ignore event when state is not set.
Browse files Browse the repository at this point in the history
When interface is not notified yet, path preference events seen before
state is present can be ignored.

Change-Id: I15eee0ffa16acb6ffb7f9737e425c29c5d7f0dcd
closes-bug: #1586143
  • Loading branch information
haripk committed Jun 2, 2016
1 parent 3dd69c7 commit 9279f1b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/vnsw/agent/oper/path_preference.cc
Expand Up @@ -809,6 +809,10 @@ bool PathPreferenceModule::DequeueEvent(PathPreferenceEventContainer event) {
const PathPreferenceIntfState *cintf_state =
static_cast<const PathPreferenceIntfState *>(
vm_intf->GetState(agent_->interface_table(), intf_id_));
if (!cintf_state) {
return true;
}

PathPreferenceIntfState *intf_state =
const_cast<PathPreferenceIntfState *>(cintf_state);
/* Only events with IPv4 IP is enqueued now */
Expand Down Expand Up @@ -887,9 +891,11 @@ void PathPreferenceModule::VrfNotify(DBTablePartBase *partition,
static_cast<PathPreferenceVrfState *>(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;
}

Expand Down

0 comments on commit 9279f1b

Please sign in to comment.