Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/12474 )
Change subject: KUDU-1900: add loopback check and test ...................................................................... Patch Set 5: (1 comment) http://gerrit.cloudera.org:8080/#/c/12474/5/src/kudu/integration-tests/security-itest.cc File src/kudu/integration-tests/security-itest.cc: http://gerrit.cloudera.org:8080/#/c/12474/5/src/kudu/integration-tests/security-itest.cc@335 PS5, Line 335: struct ifaddrs *ifap; : if (getifaddrs(&ifap) > -1) { : SCOPED_CLEANUP({ : freeifaddrs(ifap); : }); : for (struct ifaddrs *ifa = ifap; ifa; ifa = ifa->ifa_next) { : if (ifa->ifa_addr == nullptr || ifa->ifa_netmask == nullptr : || ifa->ifa_addr->sa_family != AF_INET) : continue; : : struct sockaddr_in *addr_in = reinterpret_cast<struct sockaddr_in*>(ifa->ifa_addr); : if ((NetworkByteOrder::FromHost32(addr_in->sin_addr.s_addr) >> 24) != 127) { : char s[INET_ADDRSTRLEN]; : inet_ntop(AF_INET, &(addr_in->sin_addr), s, INET_ADDRSTRLEN); : FLAGS_local_ip_for_outbound_sockets = string(s, arraysize(s)); : // Found and assigned an external IP. : return true; : } : } : } > I would not be too much concerned with efficiency in this particular case b I didn't even realize we had existing code for this in net_util.{h,cc]. Yes, we should _definitely_ reuse that code. Efficiency isn't a concern in an integration test like this. -- To view, visit http://gerrit.cloudera.org:8080/12474 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3483a9729ddeeb7901e3738532a45b49e713208f Gerrit-Change-Number: 12474 Gerrit-PatchSet: 5 Gerrit-Owner: Greg Solovyev <gsolov...@cloudera.com> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Greg Solovyev <gsolov...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Thu, 14 Feb 2019 22:38:56 +0000 Gerrit-HasComments: Yes