diff --git a/edge.c b/edge.c index 72b6e72..088e67a 100644 --- a/edge.c +++ b/edge.c @@ -139,7 +139,7 @@ static void help() { "[-p ] [-M ] " "[-r] [-E] [-v] [-i ] [-t ] [-b] [-A] [-h]\n\n"); -#ifdef __linux__ +#if defined(N2N_CAN_NAME_IFACE) printf("-d | tun device name\n"); #endif diff --git a/n2n.h b/n2n.h index 6b96e90..fb4fdca 100644 --- a/n2n.h +++ b/n2n.h @@ -38,6 +38,7 @@ #ifdef WIN32 #include "win32/n2n_win32.h" #include "win32/winconfig.h" +#define N2N_CAN_NAME_IFACE 1 #undef N2N_HAVE_DAEMON #undef N2N_HAVE_SETUID #else diff --git a/win32/wintap.c b/win32/wintap.c index e2e96bb..4ad91de 100644 --- a/win32/wintap.c +++ b/win32/wintap.c @@ -22,6 +22,7 @@ void initWin32() { } int open_wintap(struct tuntap_dev *device, + const char * devname, const char * address_mode, /* "static" or "dhcp" */ char *device_ip, char *device_mask, @@ -40,7 +41,7 @@ int open_wintap(struct tuntap_dev *device, memset(device, 0, sizeof(struct tuntap_dev)); device->device_handle = INVALID_HANDLE_VALUE; - device->device_name = NULL; + device->device_name = devname[0] ? devname : NULL; device->ifName = NULL; device->ip_addr = inet_addr(device_ip); @@ -262,7 +263,7 @@ int tuntap_open(struct tuntap_dev *device, char *device_mask, const char * device_mac, int mtu) { - return(open_wintap(device, address_mode, device_ip, device_mask, device_mac, mtu)); + return(open_wintap(device, dev, address_mode, device_ip, device_mask, device_mac, mtu)); } /* ************************************************ */