From b5cf1f927b82212fe14f9b0eb88d193cf451d51c Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 5 Apr 2019 20:19:13 +0200 Subject: [PATCH] Adjust OID_GEN_TRANSMIT_BUFFER_SPACE hint properly When transmitting, the adapter can actually take TUN_QUEUE_MAX_NBLS packets at a time. When receiving, the adapter gets up to TUN_EXCH_MAX_PACKETS packets at a time. Signed-off-by: Simon Rozman --- wintun.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wintun.c b/wintun.c index 347bb39..49acfb6 100644 --- a/wintun.c +++ b/wintun.c @@ -1274,6 +1274,8 @@ static NDIS_STATUS TunOidQuery(_Inout_ TUN_CTX *ctx, _Inout_ NDIS_OID_REQUEST *O return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE); case OID_GEN_TRANSMIT_BUFFER_SPACE: + return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE * TUN_QUEUE_MAX_NBLS); + case OID_GEN_RECEIVE_BUFFER_SPACE: return TunOidQueryWrite(OidRequest, TUN_EXCH_MAX_IP_PACKET_SIZE * TUN_EXCH_MAX_PACKETS);