Safely handle disappearing bonded interfaces (See issue #1587)

This commit is contained in:
Joseph Henry 2022-05-06 14:59:34 -07:00
parent eea93d2607
commit 6c85f8c7a7
No known key found for this signature in database
GPG key ID: C45B33FF5EBC9344
3 changed files with 135 additions and 73 deletions

View file

@ -458,9 +458,10 @@ class Bond {
*
* @param policyAlias Policy in use
* @param localSocket Local source socket
* @param createIfNeeded Whether a Link object is created if the name wasn't previously in the link map
* @return Physical link definition
*/
static SharedPtr<Link> getLinkBySocket(const std::string& policyAlias, uint64_t localSocket);
static SharedPtr<Link> getLinkBySocket(const std::string& policyAlias, uint64_t localSocket, bool createIfNeeded);
/**
* Gets a reference to a physical link definition given its human-readable system name.
@ -1141,10 +1142,10 @@ class Bond {
*
*/
void log(const char* fmt, ...)
{
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
{
#ifdef ZT_TRACE
time_t rawtime;
struct tm* timeinfo;
@ -1173,10 +1174,10 @@ class Bond {
*
*/
void debug(const char* fmt, ...)
{
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
{
#ifdef ZT_DEBUG
time_t rawtime;
struct tm* timeinfo;