Skip to content

Commit

Permalink
Merge "Label mismatch between evpna dn derived bridge route."
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Nov 26, 2015
2 parents 5194232 + db67bfd commit 8a545d5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/vnsw/agent/controller/controller_route_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,17 @@ bool ControllerVmRoute::AddChangePath(Agent *agent, AgentPath *path,
if (tunnel_bmap_ == TunnelType::VxlanType()) {
//Only VXLAN encap is sent, so label is VXLAN
path->set_vxlan_id(label_);
path->set_label(MplsTable::kInvalidLabel);
if (path->label() != MplsTable::kInvalidLabel) {
path->set_label(MplsTable::kInvalidLabel);
ret = true;
}
} else if (tunnel_bmap_ == TunnelType::MplsType()) {
//MPLS (GRE/UDP) is the only encap sent,
//so label is MPLS.
path->set_label(label_);
if (path->label() != label_) {
path->set_label(label_);
ret = true;
}
path->set_vxlan_id(VxLanTable::kInvalidvxlan_id);
} else {
//Got a mix of Vxlan and Mpls, so interpret label
Expand Down
31 changes: 31 additions & 0 deletions src/vnsw/agent/test/test_l2route.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,37 @@ TEST_F(RouteTest, Mpls_sandesh_check_with_l2route) {
client->WaitForIdle();
}

TEST_F(RouteTest, RemoteVmRoute_label_change) {
client->Reset();
VxLanNetworkIdentifierMode(false);
client->WaitForIdle();
AddEncapList("MPLSoGRE", "MPLSoUDP", "VXLAN");
client->WaitForIdle();

TunnelType::TypeBmap bmap;
bmap = TunnelType::MplsType();
AddRemoteVmRoute(remote_vm_mac_, remote_vm_ip4_, server1_ip_,
MplsTable::kStartLabel, bmap);
WAIT_FOR(1000, 100,
(L2RouteFind(vrf_name_, remote_vm_mac_, remote_vm_ip4_) == true));

BridgeRouteEntry *rt = L2RouteGet(vrf_name_, remote_vm_mac_,
remote_vm_ip4_);
EXPECT_TRUE(rt->GetActiveLabel() == MplsTable::kStartLabel);

AddRemoteVmRoute(remote_vm_mac_, remote_vm_ip4_, server1_ip_,
MplsTable::kStartLabel + 1, bmap);
rt = L2RouteGet(vrf_name_, remote_vm_mac_,
remote_vm_ip4_);
EXPECT_TRUE(rt->GetActiveLabel() == (MplsTable::kStartLabel + 1));

DeleteBridgeRoute(agent_->local_peer(), vrf_name_, remote_vm_mac_,
remote_vm_ip4_);
client->WaitForIdle();
DelEncapList();
client->WaitForIdle();
}

TEST_F(RouteTest, RemoteVmRoute_1) {
client->Reset();
VxLanNetworkIdentifierMode(false);
Expand Down

0 comments on commit 8a545d5

Please sign in to comment.