From e376fe6b89280ca56a6eea41a7933f86746975d3 Mon Sep 17 00:00:00 2001 From: Naveen N Date: Wed, 24 Jun 2015 17:28:32 +0530 Subject: [PATCH] * Dont send evpn route with NULL IPV6 address Route published with NULL ipv6 seems to be getting replicated with null IPv4 address, either case AAP configuration should not result in exporting vMAC with null IP. Closes-bug:#1403602 Change-Id: I1e6c22f40ecbd7a01a046938af674dfc44cec992 (cherry picked from commit 7b1beb720757c686c667fc8845e06918dfd7de39) --- src/vnsw/agent/oper/test/test_intf.cc | 7 +++---- src/vnsw/agent/oper/vm_interface.cc | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vnsw/agent/oper/test/test_intf.cc b/src/vnsw/agent/oper/test/test_intf.cc index 8c82315c735..dd236124ec3 100644 --- a/src/vnsw/agent/oper/test/test_intf.cc +++ b/src/vnsw/agent/oper/test/test_intf.cc @@ -2862,7 +2862,7 @@ TEST_F(IntfTest, Layer2Mode_3) { EXPECT_TRUE(L2RouteFind("vrf1", mac)); EvpnRouteEntry *evpn_rt = EvpnRouteGet("vrf1", mac, zero_ip, vm_intf->ethernet_tag()); - EXPECT_TRUE(evpn_rt != NULL); + EXPECT_TRUE(evpn_rt == NULL); evpn_rt = EvpnRouteGet("vrf1", mac, addr, vm_intf->ethernet_tag()); EXPECT_TRUE(evpn_rt != NULL); @@ -2876,8 +2876,7 @@ TEST_F(IntfTest, Layer2Mode_3) { evpn_rt = EvpnRouteGet("vrf1", mac, zero_ip, vm_intf->ethernet_tag()); - EXPECT_TRUE(evpn_rt != NULL); - EXPECT_TRUE(evpn_rt->GetActiveNextHop()->PolicyEnabled() == false); + EXPECT_TRUE(evpn_rt == NULL); evpn_rt = EvpnRouteGet("vrf1", mac, addr, vm_intf->ethernet_tag()); EXPECT_TRUE(evpn_rt == NULL); EXPECT_FALSE(RouteFindV6("vrf1", addr, 128)); @@ -2890,7 +2889,7 @@ TEST_F(IntfTest, Layer2Mode_3) { evpn_rt = EvpnRouteGet("vrf1", mac, zero_ip, vm_intf->ethernet_tag()); - EXPECT_TRUE(evpn_rt != NULL); + EXPECT_TRUE(evpn_rt == NULL); evpn_rt = EvpnRouteGet("vrf1", mac, addr, vm_intf->ethernet_tag()); EXPECT_TRUE(evpn_rt != NULL); EXPECT_TRUE(RouteFindV6("vrf1", addr, 128)); diff --git a/src/vnsw/agent/oper/vm_interface.cc b/src/vnsw/agent/oper/vm_interface.cc index 13dff23412d..724f10bd800 100644 --- a/src/vnsw/agent/oper/vm_interface.cc +++ b/src/vnsw/agent/oper/vm_interface.cc @@ -2901,7 +2901,7 @@ void VmInterface::UpdateL2InterfaceRoute(bool old_l2_active, bool force_update, path_preference, ethernet_tag_); } - if (new_ip6_addr.is_unspecified() || layer3_forwarding_ == true) { + if (new_ip6_addr.is_unspecified() == false && layer3_forwarding_ == true) { table->AddLocalVmRoute(peer_.get(), vrf_->GetName(), mac, this, new_ip6_addr, l2_label_, vn_->GetName(), sg_id_list,