Skip to content

Commit

Permalink
Merge "Agent crash @VrfEntry::DeleteTimeout" into R3.0.3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Nov 5, 2016
2 parents cc55260 + ebf9ab8 commit 182ccc5
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vnsw/agent/oper/nexthop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,9 @@ void CompositeNH::ChangeComponentNHKeyTunnelType(
ComponentNHKeyList &component_nh_key_list, TunnelType::Type type) const {

ComponentNHKeyList::iterator it = component_nh_key_list.begin();
TunnelType::Type orig_type = type;
for (;it != component_nh_key_list.end(); it++) {
type = orig_type;
if ((*it) == NULL) {
continue;
}
Expand Down
54 changes: 54 additions & 0 deletions src/vnsw/agent/test/test_nh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2540,6 +2540,60 @@ TEST_F(CfgTest, EcmpNH_20) {
EXPECT_FALSE(RouteFind("vrf1", ip, 32));
}

TEST_F(CfgTest, mcast_comp_nh_encap_change) {
struct PortInfo input[] = {
{"vnet1", 1, "1.1.1.3", "00:00:00:01:01:01", 1, 1},
};

CreateVmportWithEcmp(input, 1);
client->WaitForIdle();

MulticastHandler *mc_handler =
static_cast<MulticastHandler *>(agent_->
oper_db()->multicast());
TunnelOlist tor_olist;
tor_olist.push_back(OlistTunnelEntry(nil_uuid(), 10,
IpAddress::from_string("8.8.8.8").to_v4(),
TunnelType::VxlanType()));
mc_handler->ModifyTorMembers(bgp_peer,
"vrf1",
tor_olist,
10,
1);
client->WaitForIdle();
TunnelOlist evpn_olist;
evpn_olist.push_back(OlistTunnelEntry(nil_uuid(), 10,
IpAddress::from_string("8.8.8.8").to_v4(),
TunnelType::MplsType()));
mc_handler->ModifyEvpnMembers(bgp_peer,
"vrf1",
evpn_olist,
0,
1);
client->WaitForIdle();

BridgeRouteEntry *l2_rt =
L2RouteGet("vrf1",
MacAddress::FromString("ff:ff:ff:ff:ff:ff"),
Ip4Address(0));
CompositeNH *cnh =
dynamic_cast<CompositeNH *>(l2_rt->GetActivePath()->nexthop());
EXPECT_TRUE(cnh != NULL);
AddEncapList("MPLSoUDP", "MPLSoGRE", "VXLAN");
client->WaitForIdle();

CompositeNH *cnh_2 =
dynamic_cast<CompositeNH *>(l2_rt->GetActivePath()->nexthop());
for (ComponentNHList::const_iterator it = cnh_2->component_nh_list().begin();
it != cnh_2->component_nh_list().end(); it++) {
ASSERT_FALSE((*it) == NULL);
}

DeleteVmportEnv(input, 1, true);
WAIT_FOR(100, 1000, (VrfFind("vrf1") == false));
client->WaitForIdle();
}

int main(int argc, char **argv) {
GETUSERARGS();
client = TestInit(init_file, ksync_init);
Expand Down

0 comments on commit 182ccc5

Please sign in to comment.