From b378eb1aa8ec27ff3d9c78606ac8685f546c28ab Mon Sep 17 00:00:00 2001 From: rob-the-dude <43481893+rob-the-dude@users.noreply.github.com> Date: Sat, 2 May 2020 23:27:22 -0700 Subject: [PATCH] [posix] fix two compile-time errors for macOS utun driver (#4921) --- src/posix/platform/netif.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/posix/platform/netif.cpp b/src/posix/platform/netif.cpp index 17e3a33b6..0afb8aef6 100644 --- a/src/posix/platform/netif.cpp +++ b/src/posix/platform/netif.cpp @@ -1210,12 +1210,12 @@ static void platformConfigureTunDevice(otInstance *aInstance, (void)aInstance; - sTunFd = NonBlockSocketWithCloseExec(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL); + sTunFd = SocketWithCloseExec(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL, kSocketNonBlock); VerifyOrDie(sTunFd >= 0, OT_EXIT_ERROR_ERRNO); memset(&info, 0, sizeof(info)); strncpy(info.ctl_name, UTUN_CONTROL_NAME, strlen(UTUN_CONTROL_NAME)); - err = ioctl(fd, CTLIOCGINFO, &info); + err = ioctl(sTunFd, CTLIOCGINFO, &info); VerifyOrDie(err == 0, OT_EXIT_ERROR_ERRNO); addr.sc_id = info.ctl_id;