"edge_id" is valid only when the edge is present in the graph.
In the current code, even after deleting the edge from the graph,
the edge_id(stored in DBGraphEdge) is used for compare and lookp.
This is a problem as we could be referring to freed/reused memory.
In the problem case, the edge_id gets reused for next IFMapLink/Edge that gets added to the graph.
Problem solution:
1. we don't use "edge_id" for tree compare function (i.e. edge_id is not a key for IFMapLink Table)
2. Use string (meta data + left node + right node) as key to IFMapLink table
3. Assert if "edge_id()" is invoked on deleted DBGraphEdge()
Reviewed: https:/ /review. opencontrail. org/7949 github. org/Juniper/ contrail- controller/ commit/ 8999c53ca02762b 999aa69b8b49b17 22d69a6b95
Committed: http://
Submitter: Zuul
Branch: R2.1
commit 8999c53ca02762b 999aa69b8b49b17 22d69a6b95
Author: Prakash Bailkeri <email address hidden>
Date: Mon Mar 2 02:10:06 2015 -0800
Don'tuse edge_id as IFMAPLink table key
"edge_id" is valid only when the edge is present in the graph.
In the current code, even after deleting the edge from the graph,
the edge_id(stored in DBGraphEdge) is used for compare and lookp.
This is a problem as we could be referring to freed/reused memory.
In the problem case, the edge_id gets reused for next IFMapLink/Edge that gets added to the graph.
Problem solution:
1. we don't use "edge_id" for tree compare function (i.e. edge_id is not a key for IFMapLink Table)
2. Use string (meta data + left node + right node) as key to IFMapLink table
3. Assert if "edge_id()" is invoked on deleted DBGraphEdge()
Closes-Bug: 1426175
Change-Id: I3f8d5041cf8090 0a43c365adc164e 44acd5b5bc3