Fix warning message on duplicate IP addresses to only when trying to use

https://github.com/Hamlib/Hamlib/issues/1461
pull/1464/head
Mike Black W9MDB 2023-12-24 16:25:43 -06:00
rodzic 675ed1c85a
commit b2850ff7a8
1 zmienionych plików z 9 dodań i 8 usunięć

Wyświetl plik

@ -1065,6 +1065,13 @@ static int is_networked(char *address, int address_length)
// Convert IP address to string and ignore bad ones
if (addr)
{
if (inet_ntop(pUnicast->Address.lpSockaddr->sa_family, addr, ipString,
sizeof(ipString)) != NULL)
{
// Use IP address if not 169.x.x.x
if (strncmp(address, "169", 3) != 0)
{
count++;
@ -1074,12 +1081,6 @@ static int is_networked(char *address, int address_length)
"%s: more than 1 address found...multicast may not work\n", __func__);
}
if (inet_ntop(pUnicast->Address.lpSockaddr->sa_family, addr, ipString,
sizeof(ipString)) != NULL)
{
// Use IP address if not 169.x.x.x
if (strncmp(address,"169",3) != 0)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: Address: %s\n", ipString, ipString);
strncpy(address, ipString, address_length);
}