]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/pick_address: improves log message when no IP is found
authorRicardo Dias <rdias@suse.com>
Thu, 28 Feb 2019 11:07:55 +0000 (11:07 +0000)
committerRicardo Dias <rdias@suse.com>
Thu, 28 Feb 2019 16:25:26 +0000 (16:25 +0000)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/common/pick_address.cc

index 7b284925d51fc31d995d771076f5c5475bf9e565..4b927ae1e2aeb0065ad620facafbb8f5e689830f 100644 (file)
@@ -237,8 +237,16 @@ static int fill_in_one_address(
   const struct sockaddr *found = find_ip_in_subnet_list(cct, ifa, ipv, networks,
                                                        interfaces, numa_node);
   if (!found) {
-    lderr(cct) << "unable to find any IP address in networks '" << networks
-              << "' interfaces '" << interfaces << "'" << dendl;
+    std::string ip_type = "";
+    if ((ipv & CEPH_PICK_ADDRESS_IPV4) && (ipv & CEPH_PICK_ADDRESS_IPV6)) {
+      ip_type = "IPv4 or IPv6";
+    } else if (ipv & CEPH_PICK_ADDRESS_IPV4) {
+      ip_type = "IPv4";
+    } else {
+      ip_type = "IPv6";
+    }
+    lderr(cct) << "unable to find any " << ip_type << " address in networks '"
+               << networks << "' interfaces '" << interfaces << "'" << dendl;
     return -1;
   }