Index: runtime/bin/socket_linux.cc |
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc |
index c36a66e3e26ff76e49bed10a17dba9f4e60dca59..e50884b2427f1d8b1ffad1deedaf4a1970c0a732 100644 |
--- a/runtime/bin/socket_linux.cc |
+++ b/runtime/bin/socket_linux.cc |
@@ -11,6 +11,7 @@ |
#include <string.h> // NOLINT |
#include <sys/stat.h> // NOLINT |
#include <unistd.h> // NOLINT |
+#include <net/if.h> // NOLINT |
#include <netinet/tcp.h> // NOLINT |
#include <ifaddrs.h> // NOLINT |
@@ -298,7 +299,7 @@ AddressList<InterfaceSocketAddress>* Socket::ListInterfaces( |
for (struct ifaddrs* ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { |
if (ShouldIncludeIfaAddrs(ifa, lookup_family)) { |
addresses->SetAt(i, new InterfaceSocketAddress( |
- ifa->ifa_addr, strdup(ifa->ifa_name))); |
+ ifa->ifa_addr, strdup(ifa->ifa_name), if_nametoindex(ifa->ifa_name))); |
i++; |
} |
} |