summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli3_1-cops.c22
-rw-r--r--rpc/rpc-lib/src/protocol-common.h5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c6
3 files changed, 29 insertions, 4 deletions
diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c
index f5747261f..53f714c20 100644
--- a/cli/src/cli3_1-cops.c
+++ b/cli/src/cli3_1-cops.c
@@ -68,9 +68,25 @@ gf_cli3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
}
gf_log ("cli", GF_LOG_NORMAL, "Received resp to probe");
- cli_out ("Probe %s", (rsp.op_ret) ? "unsuccessful": "successful");
-
-
+ if (!rsp.op_ret) {
+ switch (rsp.op_errno) {
+ case GF_PROBE_SUCCESS:
+ cli_out ("Probe successful");
+ break;
+ case GF_PROBE_LOCALHOST:
+ cli_out ("Probe on localhost not needed");
+ break;
+ default:
+ cli_out ("Probe returned with unknown errno %d",
+ rsp.op_errno);
+ break;
+ }
+ }
+ if (rsp.op_ret) {
+ cli_out ("Probe unsuccessfull");
+ gf_log ("glusterd",GF_LOG_ERROR,"Probe failed with op_ret %d"
+ " and op_errno %d", rsp.op_ret, rsp.op_errno);
+ }
ret = rsp.op_ret;
out:
diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h
index 0de868a97..4df5a554f 100644
--- a/rpc/rpc-lib/src/protocol-common.h
+++ b/rpc/rpc-lib/src/protocol-common.h
@@ -134,6 +134,11 @@ enum gf_pmap_procnum {
GF_PMAP_MAXVALUE,
};
+enum gf_probe_resp {
+ GF_PROBE_SUCCESS,
+ GF_PROBE_LOCALHOST,
+ GF_PROBE_FRIEND,
+};
#define GLUSTER3_1_FOP_PROGRAM 1298437 /* Completely random */
#define GLUSTER3_1_FOP_VERSION 310 /* 3.1.0 */
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 086caf2e8..24743c21c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -519,7 +519,11 @@ glusterd_handle_cli_probe (rpcsvc_request_t *req)
gf_log ("glusterd", GF_LOG_NORMAL, "Received CLI probe req %s %d",
cli_req.hostname, cli_req.port);
-
+ if (!(ret = glusterd_is_local_addr(cli_req.hostname))) {
+ glusterd_xfer_cli_probe_resp (req, 0, GF_PROBE_LOCALHOST,
+ cli_req.hostname, cli_req.port);
+ goto out;
+ }
ret = glusterd_probe_begin (req, cli_req.hostname, cli_req.port);
out: