Skip to content

Commit

Permalink
Fix vrouter agent crash at updateksync
Browse files Browse the repository at this point in the history
Issue:
------
Flow update on BGP as a service flow, results in inline
delete of forward flow, while update doesnot expect a
renew of deleted flow in update context causing assertion

Fix:
----
while trying to associate flow and reverse flow, we should
not delete reverse of reverse flow, if it is flow itself
also since we will be making it as a short flow since it
will be detached from reverse flow, we don't need an
explicit delete

Adding flow lock for missing delete all flow API

Change-Id: I6929ee4a9c4562ab30dcb6ca9650eb0b1d8c5f2d
Closes-Bug: 1575956
(cherry picked from commit 92e685a)
  • Loading branch information
Prabhjot Singh Sethi committed Apr 30, 2016
1 parent 03df02f commit b72654f
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/vnsw/agent/pkt/flow_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ void FlowTable::DeleteAll() {
reverse_entry = it->second;
++it;
}
FLOW_LOCK(entry, reverse_entry, FlowEvent::DELETE_FLOW);
DeleteUnLocked(true, entry, reverse_entry);
}
}
Expand Down Expand Up @@ -464,19 +465,6 @@ void FlowTable::UpdateReverseFlow(FlowEntry *flow, FlowEntry *rflow) {
}
}

if (rflow && rflow->is_flags_set(FlowEntry::BgpRouterService)) {
//In BGP router service for some reason if tcp connection does not
//succeed, then client will try again with new source port and this will
//create a new flow. Now there will be two flows - one with old source
//port and other with new source port. However both of them will have
//same reverse flow as its is nat'd with fabric sip/dip.
//To avoid this delete old flow and dont let new flow to be short flow.
if (rflow_rev) {
DeleteUnLocked(rflow_rev->key(), false);
rflow_rev = NULL;
}
}

if (rflow_rev && (rflow_rev->reverse_flow_entry() == NULL)) {
rflow_rev->MakeShortFlow(FlowEntry::SHORT_NO_REVERSE_FLOW);
if (ValidFlowMove(flow, rflow_rev) == false) {
Expand Down

0 comments on commit b72654f

Please sign in to comment.