kernel-netlink: Properly clean up pending entry if VIP installation failed
This could prevent the VIP from getting installed later and actually
causes those threads to block indefinitely as they wait for the entry to
either get removed or the VIP marked as installed, which will never
happen.
Fixes: c6b401581a ("Changed how kernel-netlink handles virtual IP addresses")
This commit is contained in:
@@ -2450,6 +2450,17 @@ METHOD(kernel_net_t, add_ip, status_t,
|
||||
}
|
||||
this->lock->unlock(this->lock);
|
||||
}
|
||||
this->lock->write_lock(this->lock);
|
||||
entry = this->vips->get_match(this->vips, &lookup,
|
||||
(void*)addr_map_entry_match);
|
||||
if (entry)
|
||||
{ /* clean up the pending entry we inserted */
|
||||
iface->addrs->remove(iface->addrs, addr, NULL);
|
||||
addr_map_entry_remove(this->vips, addr, iface);
|
||||
addr_entry_destroy(addr);
|
||||
this->condvar->broadcast(this->condvar);
|
||||
}
|
||||
this->lock->unlock(this->lock);
|
||||
DBG1(DBG_KNL, "adding virtual IP %H failed", virtual_ip);
|
||||
return FAILED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user