Skip to content

Commit

Permalink
Merge "Fix NULL ptr access while logging" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Apr 29, 2016
2 parents d73508e + b829113 commit 03df02f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vnsw/agent/pkt/flow_entry.cc
Expand Up @@ -2392,8 +2392,8 @@ void FlowEntry::LogFlow(FlowEventLog::Event event, FlowTableKSyncEntry* ksync,
<< " flow->flow_handle = " << flow_handle_
<< " flow->gen_id = " << (int)gen_id_
<< " ksync = " << (void *)ksync
<< " Ksync->hash_id = " << ksync->hash_id()
<< " Ksync->gen_id = " << (int)ksync->gen_id()
<< " Ksync->hash_id = " << ((ksync != NULL) ? ksync->hash_id() : -1)
<< " Ksync->gen_id = " << ((ksync != NULL) ? (int)ksync->gen_id() : 0)
<< " new_flow_handle = " << flow_handle
<< " new_gen_id = " << (int)gen_id);

Expand All @@ -2414,8 +2414,8 @@ void FlowEntry::LogFlow(FlowEventLog::Event event, FlowTableKSyncEntry* ksync,
log->flow_handle_ = flow_handle_;
log->flow_gen_id_ = gen_id_;
log->ksync_entry_ = ksync;
log->hash_id_ = ksync->hash_id();
log->gen_id_ = ksync->gen_id();
log->hash_id_ = (ksync != NULL) ? ksync->hash_id() : -1;
log->gen_id_ = (ksync != NULL) ? ksync->gen_id() : 0;
log->vrouter_flow_handle_ = flow_handle;
log->vrouter_gen_id_ = gen_id;
}
3 changes: 3 additions & 0 deletions src/vnsw/agent/vrouter/ksync/ksync_flow_index_manager.cc
Expand Up @@ -204,6 +204,9 @@ uint8_t KSyncFlowIndexManager::AcquireIndexUnLocked(uint32_t index,
// evict current entry
evict_gen_id = old->gen_id();
if (flow) {
// KSyncEntry can be NULL at this point since acquire
// index can be done before creating KSyncEntry
// LogFlow needs to handle NULL KSyncEntry pointer
flow->LogFlow(FlowEventLog::FLOW_EVICT, flow->ksync_entry_,
flow->flow_handle(), evict_gen_id);
proto_->EvictFlowRequest(flow, flow->flow_handle(),
Expand Down

0 comments on commit 03df02f

Please sign in to comment.