Fix compilation issue in peer_close_manager.cc

Bug #1765224 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
Trunk
Fix Committed
Medium
Ananth Suryanarayana

Bug Description

g++ found that oper was uninitialized in PeerCloseManager::MembershipPathCallback() when compiled with -coverage option along with -O3.

diff --git a/src/bgp/peer_close_manager.cc b/src/bgp/peer_close_manager.cc
index d83233a..6fbc717 100644
--- a/src/bgp/peer_close_manager.cc
+++ b/src/bgp/peer_close_manager.cc
@@ -655,7 +655,7 @@ void PeerCloseManager::UpdateRouteStats(Address::Family family,
 bool PeerCloseManager::MembershipPathCallback(DBTablePartBase *root,
                                               BgpRoute *rt, BgpPath *path) {
     CHECK_CONCURRENCY("db::DBTable");
- DBRequest::DBOperation oper;
+ DBRequest::DBOperation oper = DBRequest::DB_ENTRY_INVALID;
     BgpAttrPtr attrs;

     BgpTable *table = static_cast<BgpTable *>(root->parent());
diff --git a/src/db/db_table.h b/src/db/db_table.h
index 8298726..c9c0848 100644
--- a/src/db/db_table.h
+++ b/src/db/db_table.h
@@ -34,6 +34,7 @@ public:

 struct DBRequest {
     typedef enum {
+ DB_ENTRY_INVALID = 0,
         DB_ENTRY_ADD_CHANGE = 1,
         DB_ENTRY_DELETE = 2,
         DB_ENTRY_NOTIFY = 3,

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/42122
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/42122
Committed: http://github.com/Juniper/contrail-controller/commit/c325deb36dd6c684a52962adb222d4e18ff80bfd
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit c325deb36dd6c684a52962adb222d4e18ff80bfd
Author: Ananth Suryanarayana <email address hidden>
Date: Wed Apr 18 15:31:24 2018 -0700

Fix compilation issue in peer_close_manager.cc

g++ found that oper was uninitialized in
PeerCloseManager::MembershipPathCallback() when compiled with -coverage
option along with -O3.

Change-Id: I9b412efc491d34354ebc38c8e2449ed7c0682866
Closes-Bug: 1765224

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.