Branch: refs/heads/master Home: https://github.com/fabbione/kronosnet Commit: 5773872a82a6e492ab60a4c85bdf5b87bb8000c0 https://github.com/fabbione/kronosnet/commit/5773872a82a6e492ab60a4c85bdf5b8... Author: Fabio M. Di Nitto fdinitto@redhat.com Date: 2015-03-19 (Thu, 19 Mar 2015)
Changed paths: M libknet/host.c M libknet/host.h M libknet/internals.h M libknet/link.c M libknet/threads.c
Log Message: ----------- [host] create dst_cache sync and async functions and fix link lookup race condition
Prior to this change, there was a potential race condition in which, when shutting down a link, the destination cache would not be updated in time and pckts would be lost in an invalid socket.
This change introduced a sync version of the dst cache update and protects outgoing traffic socket lookup with a mutex.
The only downside of this change is that, in future, when we will introduce complex switching algorithms, we might have to spend a bit more time recalculating the network topology on link shutdown and halt traffic switching.
Pro is that we have a smaller gap in lost traffic when reconfiguring the local node.
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com