Skip to content

Commit

Permalink
if any label Change for the bridge route happen rebake for the label is
Browse files Browse the repository at this point in the history
not happening due to that always pointing to old label.
Added Changes to handle the label change upon bridge route notify.

Change-Id: I450952b8082729fd5528f5a5a94b4cee5124fffb
closes-bug: #1641659
  • Loading branch information
jayaramsatya committed Nov 20, 2016
1 parent 97f465d commit 80b06fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions src/vnsw/agent/oper/mirror_table.cc
Expand Up @@ -448,7 +448,7 @@ bool MirrorTable::UnresolvedMirrorVrf(const VrfEntry *vrf,
}
// if the Unresolved remote mac is present it will return the entry
MirrorEntry*
MirrorTable::UnresolvedMirrorEntry(VrfEntry *vrf, const MacAddress & mac,
MirrorTable::GetMirrorEntry(VrfEntry *vrf, const MacAddress & mac,
VrfMirrorEntryList &list) {
VrfMirrorEntryList::iterator it = list.find(vrf->GetName());
if (it == list.end()) {
Expand All @@ -471,13 +471,22 @@ void MirrorTable::BridgeRouteTableNotify(DBTablePartBase *partition,
if (bridge_rt->IsDeleted()) {
ResyncResolvedMirrorEntry(bridge_rt->vrf());
} else {
MirrorEntry *mirror_entry = UnresolvedMirrorEntry(bridge_rt->vrf(),
bridge_rt->mac(),
unresolved_entry_list_);
if (mirror_entry &&
mirror_entry->mirror_flags_ ==
MirrorEntry *unresolved_mirror_entry = GetMirrorEntry(bridge_rt->vrf(),
bridge_rt->mac(),
unresolved_entry_list_);
MirrorEntry *resolved_mirror_entry = GetMirrorEntry(bridge_rt->vrf(),
bridge_rt->mac(),
resolved_entry_list_);
// Check for Both resolved and unresolved list for Change in route
if (unresolved_mirror_entry &&
unresolved_mirror_entry->mirror_flags_ ==
MirrorEntryData::DynamicNH_Without_JuniperHdr) {
ResyncUnresolvedMirrorEntry(bridge_rt->vrf());
} else if (resolved_mirror_entry &&
((resolved_mirror_entry->vni_ != bridge_rt->GetActiveLabel()) ||
(resolved_mirror_entry->nh_ !=
bridge_rt->GetActivePath()->nexthop()))) {
ResyncResolvedMirrorEntry(bridge_rt->vrf());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/vnsw/agent/oper/mirror_table.h
Expand Up @@ -160,8 +160,8 @@ class MirrorTable : public AgentDBTable {
void UnRegisterBridgeRouteTableListener(const VrfEntry *entry,
MirrorVrfState *state);
bool UnresolvedMirrorVrf(const VrfEntry *vrf, VrfMirrorEntryList &list);
MirrorEntry* UnresolvedMirrorEntry(VrfEntry *vrf, const MacAddress & mac,
VrfMirrorEntryList &list);
MirrorEntry* GetMirrorEntry(VrfEntry *vrf, const MacAddress & mac,
VrfMirrorEntryList &list);
static MirrorEntryData::MirrorEntryFlags
DecodeMirrorFlag (const std::string &nh_mode, bool juniper_header);
void DeleteMirrorVrf(MirrorEntry *entry);
Expand Down

0 comments on commit 80b06fb

Please sign in to comment.