diff --git a/src/net.cpp b/src/net.cpp index be0656f227..8e62536bcc 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -4090,8 +4090,7 @@ void Discover() { if (ifa->ifa_addr == nullptr) continue; if ((ifa->ifa_flags & IFF_UP) == 0) continue; - if (strcmp(ifa->ifa_name, "lo") == 0) continue; - if (strcmp(ifa->ifa_name, "lo0") == 0) continue; + if ((ifa->ifa_flags & IFF_LOOPBACK) != 0) continue; if (ifa->ifa_addr->sa_family == AF_INET) { struct sockaddr_in* s4 = (struct sockaddr_in*)(ifa->ifa_addr); diff --git a/src/net.h b/src/net.h index 1691f6f8d5..83ac6a1095 100644 --- a/src/net.h +++ b/src/net.h @@ -169,8 +169,7 @@ struct CSerializedNetMsg { /** * Look up IP addresses from all interfaces on the machine and add them to the * list of local addresses to self-advertise. - * The loopback interface is skipped and only the first address from each - * interface is used. + * The loopback interface is skipped. */ void Discover();