Skip to content

Commit

Permalink
Agent crash @ FlowMgmtEntry::Delete
Browse files Browse the repository at this point in the history
Problem:
Note that Flow management module and controller update module run in parallel.
In BGP service flows, to identify flow mgmt tree, CN info is needed.
When a bgp service flow is getting added keys are extracted and then flow is
added. Both these routines use GetCNIndex to identify which bgp service flow
mgmt tree to use. This can cause issue as extraction of keys may have taken some
index but by the time flow node gets added in tree CN which has been picked up
is down. In turn GetCNIndex will return invalid index and flow node does not get
added. Because of CN delete, flow delete request would have been pushed. On
serving delete request key is found but flow node is absent. This results in
crash.

Solution:
During addition of flow node use CN index from key instead of calling
GetCNIndex.

Change-Id: Ifd9adac9cdb4a03e621cf62eff009e3e55d882a5
Closes-bug: #1630011
(cherry picked from commit ea23d21)
  • Loading branch information
manishsing committed Feb 24, 2017
1 parent e522093 commit 8acab1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vnsw/agent/pkt/flow_mgmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,9 @@ void FlowMgmtManager::AddFlowMgmtKey(FlowEntry *flow, FlowEntryInfo *info,
break;

case FlowMgmtKey::BGPASASERVICE: {
int cn_index = BgpAsAServiceFlowMgmtTree::GetCNIndex(flow);
BgpAsAServiceFlowMgmtKey *bgp_service_key =
static_cast<BgpAsAServiceFlowMgmtKey *>(key);
int cn_index = bgp_service_key->cn_index();
if (cn_index != BgpAsAServiceFlowMgmtTree::kInvalidCnIndex) {
bgp_as_a_service_flow_mgmt_tree_[cn_index].get()->Add(key, flow,
(ret.second)? node : NULL);
Expand Down

0 comments on commit 8acab1f

Please sign in to comment.