Skip to content

Commit

Permalink
Fix the check for flood of arp. Add UT for same.
Browse files Browse the repository at this point in the history
Change-Id: Id2a003c815436cdb7df80820f0a6c8ad6ac6eeba
Closes-bug: 1402627
  • Loading branch information
manishsing committed Dec 15, 2014
1 parent 14484b3 commit bae44bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/vnsw/agent/oper/inet_unicast_route.cc
Expand Up @@ -420,13 +420,14 @@ bool InetUnicastRouteEntry::FloodArp() const {
Agent *agent =
(static_cast<InetUnicastAgentRouteTable *> (get_table()))->agent();
const AgentPath *local_path = FindPath(agent->local_peer());
if (local_path && (local_path->is_subnet_discard() == false))
return false;

if (GetActiveNextHop()->GetType() == NextHop::RESOLVE)
return false;
//Only look for subnet route programmed via IPAM(i.e. will have local path
//as subnet discard) and active path of that subnet route should not be
//resolve.
if (local_path && (local_path->is_subnet_discard() == true) &&
(GetActiveNextHop()->GetType() != NextHop::RESOLVE))
return true;

return true;
return false;
}

// Handle add/update of a path in route.
Expand Down
2 changes: 2 additions & 0 deletions src/vnsw/agent/test/test_route.cc
Expand Up @@ -451,6 +451,7 @@ TEST_F(RouteTest, LocalVmRoute_1) {
EXPECT_TRUE(rt->dest_vn_name() == "vn1");
EXPECT_TRUE(rt->GetActivePath()->vxlan_id() == VxLanTable::kInvalidvxlan_id);
EXPECT_TRUE(rt->GetActivePath()->tunnel_bmap() == TunnelType::MplsType());
EXPECT_FALSE(rt->FloodArp());
DeleteVmportEnv(input, 1, true);
client->WaitForIdle();

Expand All @@ -469,6 +470,7 @@ TEST_F(RouteTest, RemoteVmRoute_1) {
EXPECT_TRUE(rt->dest_vn_name() == vrf_name_);
EXPECT_TRUE(rt->GetActiveLabel() == MplsTable::kStartLabel);
EXPECT_TRUE(rt->GetActiveNextHop()->GetType() == NextHop::TUNNEL);
EXPECT_FALSE(rt->FloodArp());

DeleteRoute(NULL, vrf_name_, remote_vm_ip_, 32);
EXPECT_FALSE(RouteFind(vrf_name_, remote_vm_ip_, 32));
Expand Down

0 comments on commit bae44bc

Please sign in to comment.