Skip to content

Commit

Permalink
In agent mode tsn-no-forwarding ping in fabric failed.
Browse files Browse the repository at this point in the history
This happened because tsn-no-forwarding does not let IP route get added as it is
not a forwarding agent and is to be used for services like dhcp/dns. This
blocked fabric routes resulting in ping failure.

Solution:
Add exception for routes in fabric vrf.

Change-Id: Iadd386622e7f9756dabcaaf82782a00bacef3317
Closes-bug: #1724064
  • Loading branch information
manishsing committed Oct 18, 2017
1 parent 48a416a commit a6010dd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vnsw/agent/oper/agent_route.cc
Expand Up @@ -824,7 +824,8 @@ bool AgentRouteData::AddChangePath(Agent *agent, AgentPath *path,
local_route = true;
if (rt->FindLocalPath())
local_route = true;
if (is_inet_rt && (!service_address && !local_route))
if (is_inet_rt && (!service_address && !local_route) &&
(rt->vrf()->GetName().compare(agent->fabric_vrf_name()) != 0))
path->set_inactive(true);
}

Expand Down
24 changes: 24 additions & 0 deletions src/vnsw/agent/oper/test/test_tsn_elector.cc
Expand Up @@ -445,6 +445,30 @@ TEST_F(TsnElectorTest, Test_6) {
EXPECT_FALSE(VmPortActive(input, 0));
}

//Refer: https://bugs.launchpad.net/juniperopenstack/+bug/1724064
//Routes in fabric vrf should remain active in tsn-no-forwarding-mode
TEST_F(TsnElectorTest, Test_7) {
client->Reset();
CreateVmportEnv(input, 1);
client->WaitForIdle();
AddIPAM("vn1", ipam_info, 1);
client->WaitForIdle();
EXPECT_TRUE(VmPortActive(input, 0));

VrfEntry *fabric_vrf = agent_->fabric_vrf();
InetUnicastAgentRouteTable *inet4_table = fabric_vrf->
GetInet4UnicastRouteTable();
InetUnicastRouteEntry *default_rt =
inet4_table->FindRoute(Ip4Address::from_string("0.0.0.0"));
EXPECT_FALSE(default_rt->GetActivePath()->inactive());

//Delete
DeleteVmportEnv(input, 1, true);
DelIPAM("vn1");
client->WaitForIdle();
EXPECT_FALSE(VmPortActive(input, 0));
}

int main(int argc, char **argv) {
GETUSERARGS();
strcpy(init_file, DEFAULT_VNSW_TSN_NO_FORWARDING_CONFIG_FILE);
Expand Down

0 comments on commit a6010dd

Please sign in to comment.