diff --git a/connector/c/include/tp.h b/connector/c/include/tp.h
index 13bc4449540136c89926851a71ee1468d0b62d26..65f55de7757dd67f69c9e9c7339186b44c3d7456 100644
--- a/connector/c/include/tp.h
+++ b/connector/c/include/tp.h
@@ -550,7 +550,7 @@ tp_reply(struct tp *p) {
 	p->f = NULL;
 	p->u = NULL;
 	if (tp_unlikely(p->h->type == TP_PING))
-		return TP_PING;
+		return p->code;
 	if (tp_unlikely(p->h->type != TP_UPDATE &&
 	                p->h->type != TP_INSERT &&
 	                p->h->type != TP_DELETE &&