compile grpc v 1.3.0 with c-ares v1.9.1

38 views
Skip to first unread message

reddys...@gmail.com

unread,
Jun 23, 2017, 12:01:49 PM6/23/17
to grpc.io
I am trying to compile grpc v 1.3.0 with c-ares v 1.9.1. In this cares version ares_inet_ntop symbol is replaced with inet_ntop(if HAVE_INET_NTOP macro is defined). I compiled grpc with this patch:

@@ -154,7 +154,9 @@
         char output[INET6_ADDRSTRLEN];
         memcpy(&addr->sin6_addr, hostent->h_addr_list[i - prev_naddr],
                sizeof(struct in6_addr));
-        ares_inet_ntop(AF_INET6, &addr->sin6_addr, output, INET6_ADDRSTRLEN);
+        inet_ntop(AF_INET6, &addr->sin6_addr, output, INET6_ADDRSTRLEN);
         gpr_log(GPR_DEBUG,
                 "c-ares resolver gets a AF_INET6 result: \n"
                 "  addr: %s\n  port: %s\n  sin6_scope_id: %d\n",
@@ -169,7 +171,7 @@
         addr->sin_port = strhtons(r->port);
 
         char output[INET_ADDRSTRLEN];
-        ares_inet_ntop(AF_INET, &addr->sin_addr, output, INET_ADDRSTRLEN);
+        inet_ntop(AF_INET, &addr->sin_addr, output, INET_ADDRSTRLEN);
         gpr_log(GPR_DEBUG,
                 "c-ares resolver gets a AF_INET result: \n"
                 "  addr: %s\n  port: %s\n",

Will this change regress any grpc functionality? Thanks!

Nicolas Noble

unread,
Jun 23, 2017, 4:31:30 PM6/23/17
to reddys...@gmail.com, grpc.io
Do you mean that the file third_party/cares/cares/inet_ntop.c ceases to exist ? There are Windows vs Linux reasons for not using inet_ntop directly. See src/core/lib/iomgr/socket_utils.h for instance, with the implementations in src/core/lib/iomgr/socket_utils_common_posix.c, src/core/lib/iomgr/socket_utils_uv.c, and src/core/lib/iomgr/socket_utils_windows.c.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/086adcfe-2973-4bda-8ab8-c1b5118d1061%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Noble

unread,
Jun 23, 2017, 4:32:37 PM6/23/17
to reddys...@gmail.com, grpc.io
That being said, grpc_inet_ntop should be used instead then.

reddys...@gmail.com

unread,
Jun 26, 2017, 10:16:15 AM6/26/17
to grpc.io, reddys...@gmail.com
Thanks Nicolas. I will give it a shot.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages