diff --git a/source/managers/CommunicationManager.py b/source/managers/CommunicationManager.py index b358ae8..5aeb224 100644 --- a/source/managers/CommunicationManager.py +++ b/source/managers/CommunicationManager.py @@ -242,11 +242,21 @@ class CommunicationManager: for interface in self.get_local_addresses(): # unpack the interface information interface_family, _, _, _, interface_address = interface - interface_host, _, _, interface_scope = interface_address - # check if it matches the address interface - if host == interface_host and scope == interface_scope: - return True + match interface_family: + case socket.AF_INET: + interface_host, interface_port = interface_address + + # check if it matches the address interface + if host == interface_host: + return True + + case socket.AF_INET6: + interface_host, interface_port, interface_flowinfo, interface_scope = interface_address + + # check if it matches the address interface + if host == interface_host and scope == interface_scope: + return True # no matching interfaces have been found return False