1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-07 08:14:58 +03:00

Several Tunings for OS X

This commit is contained in:
nattoheaven
2014-03-12 08:06:21 +09:00
parent 14e8693421
commit 4c48388b12
4 changed files with 71 additions and 15 deletions

View File

@ -105,6 +105,9 @@
#include <errno.h>
#include <Mayaqua/Mayaqua.h>
#include <Cedar/Cedar.h>
#ifdef UNIX_MACOS
#include <net/ethernet.h>
#endif
#ifdef OS_UNIX
@ -524,10 +527,11 @@ int UnixCreateTapDeviceEx(char *name, char *prefix, UCHAR *mac_address)
if (mac_address != NULL)
{
uint8_t macos_mac_address[19];
Zero(&ifr, sizeof(ifr));
StrCpy(ifr.ifr_name, sizeof(ifr.ifr_name), macos_eth_name);
Copy(&ifr.ifr_addr.sa_data, mac_address, 6);
ifr.ifr_addr.sa_len = ETHER_ADDR_LEN;
ifr.ifr_addr.sa_family = AF_LINK;
Copy(&ifr.ifr_addr.sa_data, mac_address, ETHER_ADDR_LEN);
ioctl(s, SIOCSIFLLADDR, &ifr);
}