From 7fcdae34e17d58e48fdff0ff244a5964cd9fdf9d Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 13 Jul 2020 19:15:54 +0200 Subject: [PATCH] Skip interfaces where address is not set (cherry picked from commit 41e5c28030e894769dc3a51ddc76d2d6f1bd4d75) --- urbackupcommon/fileclient/FileClient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/urbackupcommon/fileclient/FileClient.cpp b/urbackupcommon/fileclient/FileClient.cpp index 4e583e1d..40e08a59 100644 --- a/urbackupcommon/fileclient/FileClient.cpp +++ b/urbackupcommon/fileclient/FileClient.cpp @@ -152,7 +152,8 @@ void FileClient::bindToNewInterfaces() !(ifap->ifa_flags & IFF_LOOPBACK) && !(ifap->ifa_flags & IFF_POINTOPOINT)) { - if (ifap->ifa_addr->sa_family == AF_INET + if (ifap->ifa_addr!=NULL + && ifap->ifa_addr->sa_family == AF_INET && (ifap->ifa_flags & IFF_BROADCAST)) { sockaddr_in source_addr; @@ -222,7 +223,8 @@ void FileClient::bindToNewInterfaces() Server->Log("Broadcasting on ipv4 interface "+std::string(ifap->ifa_name) + " addr " + ipToString(new_udpsock)); } - else if (ifap->ifa_addr->sa_family == AF_INET6 + else if (ifap->ifa_addr != NULL + && ifap->ifa_addr->sa_family == AF_INET6 && Server->getServerParameter("disable_ipv6").empty()) { sockaddr_in6 source_addr;