Greg Solovyev 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;
             :       }
             :     }
             :   }
> Is it possible to call kudu::GetLocalNetworks() and then just work with the
Yes, but it will be less efficient, because GetLocalNetworks will loop through 
all local interfaces and put them into an array, then this test will have to 
loop through the array and find non-loopback interfaces. At the same time, we 
are talking about the efficiency of 2-3 repetitions, so I don't have a strong 
opinion here



--
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 18:30:19 +0000
Gerrit-HasComments: Yes

Reply via email to