diff options
author | Craig Tiller <ctiller@google.com> | 2016-03-28 22:54:38 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-03-28 22:54:38 -0700 |
commit | 44ad3fdf060b5826416a14cc7d723eae64bacd9f (patch) | |
tree | 25b9e4fd35f6d48d49772fb6c010b2602be7a29e /src/core/lib/iomgr/udp_server.c | |
parent | 97684571012a1f40218dc31c08cb68790d325a10 (diff) | |
parent | c2011586fae18c7b247686428a2469198589a1f9 (diff) |
Merge branch 'idempotent' into ignore_connectivity
Diffstat (limited to 'src/core/lib/iomgr/udp_server.c')
-rw-r--r-- | src/core/lib/iomgr/udp_server.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index 3d8bcc9c81..9068109c3a 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -208,8 +208,6 @@ static int prepare_socket(int fd, const struct sockaddr *addr, size_t addr_len) { struct sockaddr_storage sockname_temp; socklen_t sockname_len; - int get_local_ip; - int rc; if (fd < 0) { goto error; @@ -220,14 +218,9 @@ static int prepare_socket(int fd, const struct sockaddr *addr, strerror(errno)); } - get_local_ip = 1; - rc = setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &get_local_ip, - sizeof(get_local_ip)); - if (rc == 0 && addr->sa_family == AF_INET6) { -#if !defined(__APPLE__) - rc = setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &get_local_ip, - sizeof(get_local_ip)); -#endif + if (grpc_set_socket_ip_pktinfo_if_possible(fd) && + addr->sa_family == AF_INET6) { + grpc_set_socket_ipv6_recvpktinfo_if_possible(fd); } GPR_ASSERT(addr_len < ~(socklen_t)0); |