From 0727f7ce6a162764cae3479892ef4140d5c2eb16 Mon Sep 17 00:00:00 2001 From: Ashok Singh Date: Mon, 25 Jan 2016 09:49:58 -0800 Subject: [PATCH] Ignore change notification for loadbalancer-pool. Ignore change notification for loadbalancer-pool when its ifmap-node is marked for delete. During change notification handling for loadbalancer-pool we iterate all its adjacent nodes. This iteration will result in crash if the entry is marked for delete, because the graph vertex is reset as part of ifmap_node deletion. Also fix agent crash while converting fixed_ip to V4. Change-Id: I6409e62e60952c71b7ced19d5a590e296b3b10aa Closes-Bug: #1534348 --- src/vnsw/agent/oper/loadbalancer_pool.cc | 4 ++++ src/vnsw/agent/oper/vm_interface.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vnsw/agent/oper/loadbalancer_pool.cc b/src/vnsw/agent/oper/loadbalancer_pool.cc index 43d05cddc15..2b5bb38ad7e 100644 --- a/src/vnsw/agent/oper/loadbalancer_pool.cc +++ b/src/vnsw/agent/oper/loadbalancer_pool.cc @@ -201,6 +201,10 @@ bool LoadbalancerPoolTable::OnChange(DBEntry *entry, const DBRequest *request) { LoadbalancerPoolData *data = static_cast( request->data.get()); + /* Ignore change notifications if the entry is marked for delete */ + if (data->node()->IsDeleted()) { + return false; + } assert(graph_); LoadBalancerPoolInfo properties; CalculateProperties(graph_, data->node(), &properties, &type); diff --git a/src/vnsw/agent/oper/vm_interface.cc b/src/vnsw/agent/oper/vm_interface.cc index 97e19fa7023..b3950f22d74 100644 --- a/src/vnsw/agent/oper/vm_interface.cc +++ b/src/vnsw/agent/oper/vm_interface.cc @@ -204,7 +204,7 @@ static void BuildFloatingIpList(Agent *agent, VmInterfaceConfigData *data, IpAddress fixed_ip_addr = IpAddress::from_string(fip->fixed_ip_address(), ec); if (ec.value() != 0) { - fixed_ip_addr = Ip4Address(0); + fixed_ip_addr = IpAddress(); } data->floating_ip_list_.list_.insert (VmInterface::FloatingIp(addr, vrf_node->name(), @@ -3655,7 +3655,7 @@ void VmInterface::FloatingIp::DeActivate(VmInterface *interface, bool l2) const{ const IpAddress VmInterface::FloatingIp::GetFixedIp(const VmInterface *interface) const { - if (fixed_ip_.to_v4() == Ip4Address(0)) { + if (fixed_ip_.is_unspecified()) { if (floating_ip_.is_v4() == true) { return interface->primary_ip_addr(); } else {