From 7069da2fe205905974ba5c7c49254d8478691a57 Mon Sep 17 00:00:00 2001
From: Jorge Canizales <jcanizales@google.com>
Date: Tue, 29 Sep 2015 11:29:42 -0700
Subject: [PATCH] Repeat https://github.com/grpc/grpc/issues/3049 for OSX

---
 include/grpc/support/port_platform.h | 2 --
 src/core/iomgr/udp_server.c          | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/grpc/support/port_platform.h b/include/grpc/support/port_platform.h
index d09815557e..69ff18eed6 100644
--- a/include/grpc/support/port_platform.h
+++ b/include/grpc/support/port_platform.h
@@ -174,8 +174,6 @@
 #endif /* _LP64 */
 #elif defined(__APPLE__)
 #include <TargetConditionals.h>
-/* Provides IPV6_RECVPKTINFO */
-#define __APPLE_USE_RFC_3542
 #ifndef _BSD_SOURCE
 #define _BSD_SOURCE
 #endif
diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c
index 6429c38b28..3aec1e871c 100644
--- a/src/core/iomgr/udp_server.c
+++ b/src/core/iomgr/udp_server.c
@@ -235,7 +235,7 @@ static int prepare_socket(int fd, const struct sockaddr *addr, int addr_len) {
   rc = setsockopt(fd, IPPROTO_IP, IP_PKTINFO, &get_local_ip,
                   sizeof(get_local_ip));
   if (rc == 0 && addr->sa_family == AF_INET6) {
-#if !TARGET_OS_IPHONE
+#if !defined(__APPLE__)
     rc = setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &get_local_ip,
                     sizeof(get_local_ip));
 #endif
-- 
GitLab