[posix] fix two compile-time errors for macOS utun driver (#4921)

This commit is contained in:
rob-the-dude
2020-05-02 23:27:22 -07:00
committed by GitHub
parent 7b0cb98445
commit b378eb1aa8
+2 -2
View File
@@ -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;