From c240e266d08ee3ff4493ada572412324d12c7796 Mon Sep 17 00:00:00 2001 From: Vishwanath Biradar Date: Tue, 19 Jul 2022 14:46:38 +0530 Subject: [PATCH 1/3] Added the code to work with VIA application. --- COPYRIGHT.GPL | 2 ++ src/adapter.h | 8 ++++++++ src/device.c | 8 +++++++- src/resource.rc | 6 +++--- src/tap-windows.h | 5 ++++- src/txpath.c | 21 +++++++++++++++++++++ 6 files changed, 45 insertions(+), 5 deletions(-) diff --git a/COPYRIGHT.GPL b/COPYRIGHT.GPL index d159169..b3036cf 100644 --- a/COPYRIGHT.GPL +++ b/COPYRIGHT.GPL @@ -337,3 +337,5 @@ proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. + +Copyright (C) 2022 Hewlett Packard Enterprise Development LP diff --git a/src/adapter.h b/src/adapter.h index f3840f9..978e651 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -20,6 +20,8 @@ * along with this program (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Copyright (C) 2022 Hewlett Packard Enterprise Development LP */ #ifndef __TAP_ADAPTER_CONTEXT_H_ #define __TAP_ADAPTER_CONTEXT_H_ @@ -273,6 +275,12 @@ typedef struct _TAP_ADAPTER_CONTEXT BOOLEAN m_CalledAdapterFreeResources; BOOLEAN m_RegisteredAdapterShutdownHandler; + +#ifdef ARUBA_SPECIFIC + // Handle Aruba specific logic + BOOLEAN m_IsLoadedByAruba; +#endif + } TAP_ADAPTER_CONTEXT, *PTAP_ADAPTER_CONTEXT; FORCEINLINE diff --git a/src/device.c b/src/device.c index da5df2d..999a4cb 100644 --- a/src/device.c +++ b/src/device.c @@ -20,6 +20,8 @@ * along with this program (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Copyright (C) 2022 Hewlett Packard Enterprise Development LP */ // @@ -703,7 +705,11 @@ Return Value: Irp->IoStatus.Status = ntStatus = STATUS_INVALID_PARAMETER; } break; - +#ifdef ARUBA_SPECIFIC + case TAP_WIN_IOCTL_CONFIG_LOADER_FLAG: + adapter->m_IsLoadedByAruba = TRUE; + break; +#endif default: // diff --git a/src/resource.rc b/src/resource.rc index 229e437..1561c30 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -36,11 +36,11 @@ VFT2_DRV_COMM */ -#define VER_COMPANYNAME_STR "The OpenVPN Project" -#define VER_FILEDESCRIPTION_STR "TAP-Windows Virtual Network Driver (NDIS 6.0)" +#define VER_COMPANYNAME_STR "Hewlett Packard Enterprise" +#define VER_FILEDESCRIPTION_STR "Aruba Networks Virtual Adapter" #define VER_ORIGINALFILENAME_STR PRODUCT_TAP_WIN_COMPONENT_ID ".sys" #define VER_LEGALCOPYRIGHT_YEARS "2003-2018" -#define VER_LEGALCOPYRIGHT_STR "OpenVPN Technologies, Inc." +#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 2022 Hewlett Packard Enterprise Development LP." #define VER_PRODUCTNAME_STR VER_FILEDESCRIPTION_STR diff --git a/src/tap-windows.h b/src/tap-windows.h index 4223153..6907ef1 100644 --- a/src/tap-windows.h +++ b/src/tap-windows.h @@ -53,6 +53,9 @@ /* Control whether 802.1Q headers are added for priority */ #define TAP_WIN_IOCTL_PRIORITY_BEHAVIOR TAP_WIN_CONTROL_CODE (11, METHOD_BUFFERED) +#ifdef ARUBA_SPECIFIC +#define TAP_WIN_IOCTL_CONFIG_LOADER_FLAG TAP_WIN_CONTROL_CODE (12, METHOD_BUFFERED) +#endif #define TAP_PRIORITY_BEHAVIOR_NOPRIORITY 0 #define TAP_PRIORITY_BEHAVIOR_ENABLED 1 #define TAP_PRIORITY_BEHAVIOR_ADDALWAYS 2 @@ -77,6 +80,6 @@ #define USERMODEDEVICEDIR "\\\\.\\Global\\" #define SYSDEVICEDIR "\\Device\\" #define USERDEVICEDIR "\\DosDevices\\Global\\" -#define TAP_WIN_SUFFIX ".tap" +#define TAP_WIN_SUFFIX ".avnic" #endif // __TAP_WIN_H diff --git a/src/txpath.c b/src/txpath.c index 7a6b592..981fee9 100644 --- a/src/txpath.c +++ b/src/txpath.c @@ -20,6 +20,8 @@ * along with this program (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Copyright (C) 2022 Hewlett Packard Enterprise Development LP */ // @@ -221,6 +223,21 @@ ProcessARP( __in const MACADDR mac ) { + +#ifdef ARUBA_SPECIFIC + BOOLEAN bIsDestinationSame = FALSE; + + if (TRUE == Adapter->m_IsLoadedByAruba) + { + bIsDestinationSame = TRUE; + } + else + { + bIsDestinationSame = (src->m_ARP_IP_Destination & ip_netmask) == ip_network ? TRUE : FALSE; + } +#endif //ARUBA_SPECIFIC + + //----------------------------------------------- // Is this the kind of packet we are looking for? //----------------------------------------------- @@ -234,7 +251,11 @@ ProcessARP( && src->m_PROTO_AddressType == htons (NDIS_ETH_TYPE_IPV4) && src->m_PROTO_AddressSize == sizeof (IPADDR) && src->m_ARP_IP_Source == adapter_ip +#ifndef ARUBA_SPECIFIC && (src->m_ARP_IP_Destination & ip_netmask) == ip_network +#else + && bIsDestinationSame +#endif && src->m_ARP_IP_Destination != adapter_ip) { ARP_PACKET *arp = (ARP_PACKET *) MemAlloc (sizeof (ARP_PACKET), TRUE); From 06f60b008b90d2394195e0323e2c9db5416243b8 Mon Sep 17 00:00:00 2001 From: Vishwanath Biradar Date: Mon, 1 Aug 2022 16:52:06 +0530 Subject: [PATCH 2/3] Corrected the copyright info. --- COPYRIGHT.GPL | 2 +- src/adapter.h | 2 +- src/device.c | 2 +- src/resource.rc | 2 +- src/tap-windows.h | 2 ++ src/txpath.c | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/COPYRIGHT.GPL b/COPYRIGHT.GPL index b3036cf..1c25156 100644 --- a/COPYRIGHT.GPL +++ b/COPYRIGHT.GPL @@ -338,4 +338,4 @@ consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. -Copyright (C) 2022 Hewlett Packard Enterprise Development LP +Copyright 2022 Hewlett Packard Enterprise Development LP diff --git a/src/adapter.h b/src/adapter.h index 978e651..b77b747 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -21,7 +21,7 @@ * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Copyright (C) 2022 Hewlett Packard Enterprise Development LP + * Copyright 2022 Hewlett Packard Enterprise Development LP */ #ifndef __TAP_ADAPTER_CONTEXT_H_ #define __TAP_ADAPTER_CONTEXT_H_ diff --git a/src/device.c b/src/device.c index 999a4cb..a72cc03 100644 --- a/src/device.c +++ b/src/device.c @@ -21,7 +21,7 @@ * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Copyright (C) 2022 Hewlett Packard Enterprise Development LP + * Copyright 2022 Hewlett Packard Enterprise Development LP */ // diff --git a/src/resource.rc b/src/resource.rc index 1561c30..2710ad7 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -40,7 +40,7 @@ #define VER_FILEDESCRIPTION_STR "Aruba Networks Virtual Adapter" #define VER_ORIGINALFILENAME_STR PRODUCT_TAP_WIN_COMPONENT_ID ".sys" #define VER_LEGALCOPYRIGHT_YEARS "2003-2018" -#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 2022 Hewlett Packard Enterprise Development LP." +#define VER_LEGALCOPYRIGHT_STR "Copyright 2022 Hewlett Packard Enterprise Development LP." #define VER_PRODUCTNAME_STR VER_FILEDESCRIPTION_STR diff --git a/src/tap-windows.h b/src/tap-windows.h index 6907ef1..674e9fb 100644 --- a/src/tap-windows.h +++ b/src/tap-windows.h @@ -21,6 +21,8 @@ * along with this program (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Copyright 2022 Hewlett Packard Enterprise Development LP */ #ifndef __TAP_WIN_H #define __TAP_WIN_H diff --git a/src/txpath.c b/src/txpath.c index 981fee9..7301771 100644 --- a/src/txpath.c +++ b/src/txpath.c @@ -21,7 +21,7 @@ * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * Copyright (C) 2022 Hewlett Packard Enterprise Development LP + * Copyright 2022 Hewlett Packard Enterprise Development LP */ // From e01bed1949f6bc4c0ebf01ee42f64191d5bd7046 Mon Sep 17 00:00:00 2001 From: Vishwanath Biradar Date: Wed, 19 Jul 2023 10:23:47 +0530 Subject: [PATCH 3/3] Fixed the issue where configured MTU value was not being used. --- src/adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adapter.c b/src/adapter.c index 78616d9..e3cc322 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -722,7 +722,7 @@ AdapterCreate( // Specifiy the maximum network frame size, in bytes, that the NIC // supports excluding the header. // - genAttributes.MtuSize = TAP_FRAME_MAX_DATA_SIZE; + genAttributes.MtuSize = adapter->MtuSize; genAttributes.MaxXmitLinkSpeed = TAP_XMIT_SPEED; genAttributes.XmitLinkSpeed = TAP_XMIT_SPEED; genAttributes.MaxRcvLinkSpeed = TAP_RECV_SPEED;