Signed-off-by: Simon Rozman
---
src/openvpn/tun.c | 117 +++---
src/openvpn/tun.h | 8 ++--
2 files changed, 63 insertions(+), 62 deletions(-)
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 070b0fa0..47c3088d 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -817,7 +817,7 @@ init_tun_post(struct tuntap *tt,
tt->rw_handle.read = tt->reads.overlapped.hEvent;
tt->rw_handle.write = tt->writes.overlapped.hEvent;
}
-#endif
+#endif /* ifdef _WIN32 */
}
#if defined(_WIN32)\
@@ -1397,18 +1397,18 @@ do_ifconfig_ipv4(struct tuntap *tt, const char *ifname,
int tun_mtu,
{
switch (tt->options.ip_win32_type)
{
-case IPW32_SET_MANUAL:
-msg(M_INFO,
-" NOTE: Please manually set the IP/netmask of
'%s' to %s/%s (if it is not already set)",
-ifname, ifconfig_local,
-print_in_addr_t(tt->adapter_netmask, 0, ));
-break;
-
-case IPW32_SET_NETSH:
-netsh_ifconfig(>options, ifname, tt->local,
- tt->adapter_netmask, NI_IP_NETMASK|NI_OPTIONS);
-
-break;
+case IPW32_SET_MANUAL:
+msg(M_INFO,
+" NOTE: Please manually set the IP/netmask of
'%s' to %s/%s (if it is not already set)",
+ifname, ifconfig_local,
+print_in_addr_t(tt->adapter_netmask, 0, ));
+break;
+
+case IPW32_SET_NETSH:
+netsh_ifconfig(>options, ifname, tt->local,
+ tt->adapter_netmask,
NI_IP_NETMASK|NI_OPTIONS);
+
+break;
}
}
}
@@ -3481,7 +3481,7 @@ tun_finalize(
}
static const struct device_instance_id_interface *
-get_device_instance_id_interface(struct gc_arena* gc)
+get_device_instance_id_interface(struct gc_arena *gc)
{
HDEVINFO dev_info_set;
DWORD err;
@@ -3552,7 +3552,7 @@ get_device_instance_id_interface(struct gc_arena* gc)
}
cr = CM_Get_Device_Interface_List_Size(_interface_list_size,
- (LPGUID)& GUID_DEVINTERFACE_NET,
+ (LPGUID)_DEVINTERFACE_NET,
device_instance_id,
CM_GET_DEVICE_INTERFACE_LIST_PRESENT);
@@ -3562,7 +3562,7 @@ get_device_instance_id_interface(struct gc_arena* gc)
}
dev_interface_list = alloc_buf_gc(dev_interface_list_size, gc);
-cr = CM_Get_Device_Interface_List((LPGUID)& GUID_DEVINTERFACE_NET,
device_instance_id,
+cr = CM_Get_Device_Interface_List((LPGUID)_DEVINTERFACE_NET,
device_instance_id,
BPTR(_interface_list),
dev_interface_list_size,
CM_GET_DEVICE_INTERFACE_LIST_PRESENT);
@@ -3571,7 +3571,7 @@ get_device_instance_id_interface(struct gc_arena* gc)
goto next;
}
-struct device_instance_id_interface* dev_if;
+struct device_instance_id_interface *dev_if;
ALLOC_OBJ_CLEAR_GC(dev_if, struct device_instance_id_interface, gc);
dev_if->net_cfg_instance_id = string_alloc(net_cfg_instance_id, gc);
dev_if->device_interface_list =
string_alloc(BSTR(_interface_list), gc);
@@ -3587,7 +3587,7 @@ get_device_instance_id_interface(struct gc_arena* gc)
}
last = dev_if;
-next:
+next:
RegCloseKey(dev_key);
}
@@ -3694,8 +3694,8 @@ get_tap_reg(struct gc_arena *gc)
{
/* Is this adapter supported? */
enum windows_driver_type windows_driver =
WINDOWS_DRIVER_UNSPECIFIED;
-if (strcasecmp(component_id, TAP_WIN_COMPONENT_ID) == 0 ||
-strcasecmp(component_id, "root\\"
TAP_WIN_COMPONENT_ID) == 0)
+if (strcasecmp(component_id, TAP_WIN_COMPONENT_ID) == 0
+|| strcasecmp(component_id, "root\\"
TAP_WIN_COMPONENT_ID) == 0)
{
windows_driver = WINDOWS_DRIVER_TAP_WINDOWS6;
}
@@ -5768,8 +5768,8 @@ tuntap_get_version_info(const struct tuntap *tt)
DWORD len;
CLEAR(info);
if (DeviceIoControl(tt->hand, TAP_WIN_IOCTL_GET_VERSION,
-, sizeof(info),
-, sizeof(info), , NULL))
+, sizeof(info),
+, sizeof(info), , NULL))
{
msg(D_TUNTAP_INFO, "TAP-Windows Driver Version %d.%d %s",
(int)info[0],
@@ -5808,8 +5808,8 @@ tuntap_get_mtu(struct tuntap *tt)
ULONG mtu = 0;
DWORD len;
if (DeviceIoControl(tt->hand,