github-actions[bot] commented on code in PR #16617:
URL: https://github.com/apache/doris/pull/16617#discussion_r1121395013


##########
be/src/service/backend_options.cpp:
##########
@@ -101,6 +110,48 @@ bool BackendOptions::analyze_priority_cidrs() {
     return true;
 }
 
+bool BackendOptions::get_network_interfaces() {
+    if (config::network_interfaces == "") {
+        return true;
+    }
+    LOG(INFO) << "network name in conf: " << config::network_interfaces;
+
+    struct ifaddrs * ifAddrStruct = NULL;

Review Comment:
   warning: use nullptr [modernize-use-nullptr]
   
   ```suggestion
       struct ifaddrs * ifAddrStruct = nullptr;
   ```
   



##########
be/src/service/backend_options.cpp:
##########
@@ -101,6 +110,48 @@
     return true;
 }
 
+bool BackendOptions::get_network_interfaces() {
+    if (config::network_interfaces == "") {
+        return true;
+    }
+    LOG(INFO) << "network name in conf: " << config::network_interfaces;
+
+    struct ifaddrs * ifAddrStruct = NULL;
+    void * tmpAddrPtr = NULL;
+
+    getifaddrs(&ifAddrStruct); 
+
+    std::vector<std::string> name_strs =
+            strings::Split(config::network_interfaces, 
PRIORITY_CIDR_SEPARATOR);
+    bool flag = false;
+
+    for (auto& name_str : name_strs) {
+        while (ifAddrStruct!=NULL) {

Review Comment:
   warning: use nullptr [modernize-use-nullptr]
   
   ```suggestion
           while (ifAddrStruct!=nullptr) {
   ```
   



##########
be/src/service/backend_options.cpp:
##########
@@ -101,6 +110,48 @@
     return true;
 }
 
+bool BackendOptions::get_network_interfaces() {
+    if (config::network_interfaces == "") {
+        return true;
+    }
+    LOG(INFO) << "network name in conf: " << config::network_interfaces;
+
+    struct ifaddrs * ifAddrStruct = NULL;
+    void * tmpAddrPtr = NULL;

Review Comment:
   warning: use nullptr [modernize-use-nullptr]
   
   ```suggestion
       void * tmpAddrPtr = nullptr;
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to