Skip to content

Commit

Permalink
Fix infinite loop in getVlanRangesByIface
Browse files Browse the repository at this point in the history
This code gets triggered on handlePortStatusUpdate and would result in the
opflex agent getting stuck in an infinite loop because the iterator is
not being incremented in the while loop.

---------------------------------------------------------------------------
Simple way to repro the issue is to add or del the patch ports on br-fabric
example:
ovs-vsctl del-port br-fabric qpi2b4b79dd-6e
ovs-vsctl add-port br-fabric qpi2b4b79dd-6e -- set interface qpi2b4b79dd-6e type=patch options:peer=qpf2b4b79dd-6e
Or
ovs-vsctl del-port br-fabric patch-fabric-ex
ovs-vsctl add-port br-fabric patch-fabric-ex -- set interface patch-fabric-ex type=patch options:peer=patch-ex-fabric
---------------------------------------------------------------------------
Verified we come out of the loop with the fix.

Change-Id: Ia330e40942083e9d289e256b951cc803a35e4864
Signed-off-by: Madhu Challa <challa@gmail.com>
  • Loading branch information
mchalla committed Oct 17, 2018
1 parent f9c656e commit f03095e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agent-ovs/lib/LearningBridgeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ getVlanRangesByIface(const std::string& uuid,
auto it = lbi_map.find(uuid);
if (it == lbi_map.end()) return;

LOG(DEBUG) << "getVlanRangesByIface for " << uuid;
for (auto r : it->second.iface->getTrunkVlans()) {
auto it = range_lbi_map.find(r);

Expand All @@ -351,6 +352,7 @@ getVlanRangesByIface(const std::string& uuid,
break;

ranges.insert(it->first);
it++;
}
}
}
Expand Down

0 comments on commit f03095e

Please sign in to comment.