diff --git a/src/net.cpp b/src/net.cpp index 1eda98253a4..a3b1fe6d169 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3113,8 +3113,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 af41988ba03..8075975d620 100644 --- a/src/net.h +++ b/src/net.h @@ -137,8 +137,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();