From c9bfd0040acb1f79a526468751917ebe3787b1a4 Mon Sep 17 00:00:00 2001 From: ahedberg Date: Thu, 24 Mar 2016 13:05:29 -0400 Subject: [PATCH] re-add grpc_set_socket_ipv6... --- src/core/iomgr/socket_utils_common_posix.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/iomgr/socket_utils_common_posix.c b/src/core/iomgr/socket_utils_common_posix.c index 7b264a66504..594660f76dc 100644 --- a/src/core/iomgr/socket_utils_common_posix.c +++ b/src/core/iomgr/socket_utils_common_posix.c @@ -99,6 +99,16 @@ int grpc_set_socket_ip_pktinfo_if_possible(int fd) { #endif } +int grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) { +#ifdef GPR_HAVE_IPV6_RECVPKTINFO + int get_local_ip = 1; + return setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &get_local_ip, + sizeof(get_local_ip)); +#else + return 1; +#endif +} + /* set a socket to close on exec */ int grpc_set_socket_cloexec(int fd, int close_on_exec) { int oldflags = fcntl(fd, F_GETFD, 0);