Skip to content

Commit

Permalink
Merge "Validation checks and diagnostics." into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 4, 2016
2 parents ed8eea3 + 629349b commit 14c34dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/vnsw/agent/oper/agent_path.cc
Expand Up @@ -39,7 +39,7 @@ AgentPath::AgentPath(const Peer *peer, AgentRoute *rt):
is_subnet_discard_(false), dependant_rt_(rt), path_preference_(),
local_ecmp_mpls_label_(rt), composite_nh_key_(NULL), subnet_service_ip_(),
arp_mac_(), arp_interface_(NULL), arp_valid_(false),
ecmp_suppressed_(false) {
ecmp_suppressed_(false), peer_str_(peer ? peer->GetName() : "UNKNOWN") {
}

AgentPath::~AgentPath() {
Expand Down
1 change: 1 addition & 0 deletions src/vnsw/agent/oper/agent_path.h
Expand Up @@ -344,6 +344,7 @@ class AgentPath : public Path {
// by taking only one of the nexthop from the path
bool ecmp_suppressed_;
EcmpLoadBalance ecmp_load_balance_;
std::string peer_str_;
DISALLOW_COPY_AND_ASSIGN(AgentPath);
};

Expand Down
9 changes: 9 additions & 0 deletions src/vnsw/agent/oper/mpls.cc
Expand Up @@ -65,11 +65,20 @@ bool MplsTable::OnChange(DBEntry *entry, const DBRequest *req) {
return ret;
}

void ValidateNH(const MplsLabel *mpls, NextHop *nh) {
CompositeNH *cnh = dynamic_cast<CompositeNH *>(nh);
if (!cnh)
return;
if (cnh->composite_nh_type() == Composite::L2COMP)
assert(mpls->GetType() == MplsLabel::MCAST_NH);
}

bool MplsTable::ChangeNH(MplsLabel *mpls, NextHop *nh) {
if (mpls == NULL)
return false;

if (mpls->nh_ != nh) {
ValidateNH(mpls, nh);
mpls->nh_ = nh;
assert(nh);
mpls->SyncDependentPath();
Expand Down

0 comments on commit 14c34dc

Please sign in to comment.