gavinchou commented on code in PR #45255:
URL: https://github.com/apache/doris/pull/45255#discussion_r1880520181
##########
cloud/src/common/network_util.cpp:
##########
@@ -158,8 +159,21 @@ static bool get_hosts_v4(std::vector<InetAddress>* hosts) {
return true;
}
+// Check if ip eq 127.0.0.1, ms/recycler exit
+static void check_is_loopback(const std::string& localhost_str) {
+ if (config::prohibit_use_loopback_addresses && "127.0.0.1" ==
localhost_str) {
+ LOG(WARNING) << "enable check prohibit use loopback addr, but
localhost=" << localhost_str
+ << ", so exit(-1)";
+ exit(-1);
+ }
+}
+
std::string get_local_ip(const std::string& priority_networks) {
std::string localhost_str = butil::my_ip_cstr();
+ std::unique_ptr<int, std::function<void(int*)>> defer((int*)0x01,
[&localhost_str](int*) {
Review Comment:
we should return an error if it is a loop back address.
logging is not enough, and we should remind user to use priority network CIDR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]