From: Oliver Kurth Date: Sun, 21 Jul 2019 00:15:19 +0000 (-0700) Subject: Use two new inline functions to replace most of the uses of X-Git-Tag: stable-11.1.0~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05ec637bb53442b2a7139a99027dc2593f3886a7;p=thirdparty%2Fopen-vm-tools.git Use two new inline functions to replace most of the uses of HGFS_LARGE_IO_MAX and HGFS_LARGE_PACKET_MAX macros. In preparation to bump up HGFS_LARGE_IO_MAX and HGFS_LARGE_PACKET_MAX, replace most uses of the two macro constants with inline functions that can return either the new limits or the older defaults based on the configuration. --- diff --git a/open-vm-tools/lib/hgfsBd/hgfsBd.c b/open-vm-tools/lib/hgfsBd/hgfsBd.c index c7e039bed..0b8617acb 100644 --- a/open-vm-tools/lib/hgfsBd/hgfsBd.c +++ b/open-vm-tools/lib/hgfsBd/hgfsBd.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2016,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -136,7 +136,7 @@ HgfsBd_GetBuf(void) char * HgfsBd_GetLargeBuf(void) { - return HgfsBdGetBufInt(HGFS_LARGE_PACKET_MAX); + return HgfsBdGetBufInt(HgfsLargePacketMax(FALSE)); } @@ -279,7 +279,7 @@ HgfsBd_Dispatch(RpcOut *out, // IN: Channel to send on return -1; } - ASSERT(replyLen <= HGFS_LARGE_PACKET_MAX); + ASSERT(replyLen <= HgfsLargePacketMax(TRUE)); *packetOut = reply; *packetSize = replyLen; @@ -324,7 +324,7 @@ HgfsBd_Enabled(RpcOut *out, // IN: RPCI Channel HGFS_CLIENT_CMD_LEN, &rpcStatus, &replyPacket, &replyLen); if (success && rpcStatus) { - ASSERT(replyLen <= HGFS_LARGE_PACKET_MAX); + ASSERT(replyLen <= HgfsLargePacketMax(TRUE)); } return success && rpcStatus; diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c b/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c index 942b1b82a..e5686b473 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServerParameters.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2010-2018 VMware, Inc. All rights reserved. + * Copyright (C) 2010-2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -149,7 +149,7 @@ HgfsValidateReplySize(char const *packetIn, if (HGFS_OP_NEW_HEADER != request->op) { if (HGFS_OP_READ_V3 == op) { - result = packetSize <= HGFS_LARGE_PACKET_MAX; + result = packetSize <= HgfsLargePacketMax(FALSE); } else { result = packetSize <= HGFS_PACKET_MAX; } diff --git a/open-vm-tools/lib/include/hgfs.h b/open-vm-tools/lib/include/hgfs.h index b32ce1057..df658bb87 100644 --- a/open-vm-tools/lib/include/hgfs.h +++ b/open-vm-tools/lib/include/hgfs.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2016 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2016,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -53,31 +53,97 @@ #include "includeCheck.h" #include "vm_assert.h" +/* Page size for HGFS packet (4K). */ +#define HGFS_PAGE_SIZE 4096 + +/* + * Maximum allowed header size in bytes. + */ +#define HGFS_HEADER_SIZE_MAX 2048 + /* * Maximum number of pages to transfer to/from the HGFS server for V3 protocol * operations that support large requests/replies, e.g. reads and writes. */ #define HGFS_LARGE_IO_MAX_PAGES 15 +/* Maximum number of bytes to read or write to a hgfs server in a single packet. */ +#define HGFS_IO_MAX HGFS_PAGE_SIZE + /* * Maximum allowed packet size in bytes. All hgfs code should be made * safe with respect to this limit. */ #define HGFS_PACKET_MAX 6144 +/* Maximum number of bytes to read or write to a V3 server in a single hgfs packet. */ +#define HGFS_LARGE_IO_MAX (HGFS_PAGE_SIZE * HGFS_LARGE_IO_MAX_PAGES) + /* * The HGFS_LARGE_PACKET_MAX size is used to allow guests to make * read / write requests of sizes larger than HGFS_PACKET_MAX. The larger size * can only be used with server operations that are specified to be large packet * capable in hgfsProto.h. */ -#define HGFS_LARGE_PACKET_MAX ((4096 * HGFS_LARGE_IO_MAX_PAGES) + 2048) +#define HGFS_LARGE_PACKET_MAX (HGFS_LARGE_IO_MAX + HGFS_HEADER_SIZE_MAX) -/* Maximum number of bytes to read or write to a hgfs server in a single packet. */ -#define HGFS_IO_MAX 4096 +/* + *----------------------------------------------------------------------------- + * + * HgfsLargeIoMax -- + * + * Gets the maximum number of bytes to read or write to a V3 server in a + * single hgfs packet. + * By default, a caller should pass useLegacy=FALSE to get its value with the + * control of feature switch. Passing useLegacy=TRUE means you want to + * directly use the legacy value. + * + * Results: + * Returns the maximum number of bytes to read or write to a V3 server in a + * single hgfs packet. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ -/* Maximum number of bytes to read or write to a V3 server in a single hgfs packet. */ -#define HGFS_LARGE_IO_MAX (HGFS_LARGE_IO_MAX_PAGES * 4096) +static INLINE size_t HgfsLargeIoMax(Bool useLegacy) // IN +{ + if (useLegacy) { + // TODO: Return the legacy value + } + return HGFS_LARGE_IO_MAX; +} + +/* + *----------------------------------------------------------------------------- + * + * HgfsLargePacketMax -- + * + * Gets the maximum number of bytes to allow guests to make read / write + * requests. + * By default, a caller should pass useLegacy=FALSE to get its value with the + * control of feature switch. Passing useLegacy=TRUE means you want to + * directly use the legacy value. + * + * Results: + * Returns the maximum number of bytes to allow guests to make read / write + * requests. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE size_t HgfsLargePacketMax(Bool useLegacy) // IN +{ + if (useLegacy) { + // TODO: Return the legacy value + } + return HGFS_LARGE_PACKET_MAX; +} /* * File type diff --git a/open-vm-tools/vmhgfs-fuse/bdhandler.c b/open-vm-tools/vmhgfs-fuse/bdhandler.c index 968e52af8..12a74ad76 100644 --- a/open-vm-tools/vmhgfs-fuse/bdhandler.c +++ b/open-vm-tools/vmhgfs-fuse/bdhandler.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013 VMware, Inc. All rights reserved. + * Copyright (C) 2013,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -166,7 +166,7 @@ HgfsBdChannelSend(HgfsTransportChannel *channel, // IN: Channel ASSERT(req); ASSERT(req->state == HGFS_REQ_STATE_UNSENT); - ASSERT(req->payloadSize <= HGFS_LARGE_PACKET_MAX); + ASSERT(req->payloadSize <= HgfsLargePacketMax(FALSE)); pthread_mutex_lock(&channel->connLock); diff --git a/open-vm-tools/vmhgfs-fuse/dir.c b/open-vm-tools/vmhgfs-fuse/dir.c index e71b7afd8..44fda2e47 100644 --- a/open-vm-tools/vmhgfs-fuse/dir.c +++ b/open-vm-tools/vmhgfs-fuse/dir.c @@ -71,7 +71,7 @@ HgfsPackDirOpenRequest(const char *path, // IN: Path of the dir to open reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), requestV3->dirName.name); if (result < 0) { LOG(4, ("CP conversion failed\n")); @@ -92,7 +92,7 @@ HgfsPackDirOpenRequest(const char *path, // IN: Path of the dir to open reqSize = sizeof *request; /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), request->dirName.name); if (result < 0) { LOG(4, ("CP conversion failed\n")); @@ -638,7 +638,7 @@ HgfsPackCreateDirRequest(const char *path, requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), requestV3->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -666,7 +666,7 @@ HgfsPackCreateDirRequest(const char *path, /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), requestV2->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -692,7 +692,7 @@ HgfsPackCreateDirRequest(const char *path, reqSize = sizeof *request; /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), request->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -867,7 +867,7 @@ HgfsDelete(const char* path, // IN: Path to file request->hints = 0; /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), + HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize), request->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -889,7 +889,7 @@ HgfsDelete(const char* path, // IN: Path to file reqSize = sizeof *request; /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), + HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize), request->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); diff --git a/open-vm-tools/vmhgfs-fuse/file.c b/open-vm-tools/vmhgfs-fuse/file.c index 0b6c48bce..2ca2d95d2 100644 --- a/open-vm-tools/vmhgfs-fuse/file.c +++ b/open-vm-tools/vmhgfs-fuse/file.c @@ -92,7 +92,7 @@ HgfsPackOpenRequest(const char *path, // IN: Path to file /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), requestV3->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -136,7 +136,7 @@ HgfsPackOpenRequest(const char *path, // IN: Path to file /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), requestV2->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -170,7 +170,7 @@ HgfsPackOpenRequest(const char *path, // IN: Path to file /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (reqSize - 1), + HgfsLargePacketMax(FALSE) - (reqSize - 1), request->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -694,8 +694,8 @@ HgfsRead(struct fuse_file_info *fi, // IN: File info struct fi->fh, count, offset)); do { - nextCount = (remainingCount > HGFS_LARGE_IO_MAX) ? - HGFS_LARGE_IO_MAX : remainingCount; + nextCount = (remainingCount > HgfsLargeIoMax(FALSE)) ? + HgfsLargeIoMax(FALSE) : remainingCount; LOG(4, ("Issue DoRead(0x%"FMT64"x 0x%"FMTSZ"x bytes @ 0x%"FMT64"x)\n", fi->fh, nextCount, curOffset)); result = HgfsDoRead(fi->fh, buffer, nextCount, curOffset); @@ -880,8 +880,8 @@ HgfsWrite(struct fuse_file_info *fi, // IN: File info structure fi->fh, count, offset)); do { - nextCount = (remainingCount > HGFS_LARGE_IO_MAX) ? - HGFS_LARGE_IO_MAX : remainingCount; + nextCount = (remainingCount > HgfsLargeIoMax(FALSE)) ? + HgfsLargeIoMax(FALSE) : remainingCount; LOG(4, ("Issue DoWrite(0x%"FMT64"x 0x%"FMTSZ"x bytes @ 0x%"FMT64"x)\n", fi->fh, nextCount, curOffset)); @@ -958,7 +958,7 @@ retry: reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); /* Convert old name to CP format. */ result = CPName_ConvertTo(from, - HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), + HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize), requestV3->oldName.name); if (result < 0) { LOG(4, ("oldName CP conversion failed\n")); @@ -974,7 +974,7 @@ retry: reqSize = sizeof *request; /* Convert old name to CP format. */ result = CPName_ConvertTo(from, - HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize), + HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize), request->oldName.name); if (result < 0) { LOG(4, ("oldName CP conversion failed\n")); @@ -1004,7 +1004,7 @@ retry: /* Convert new name to CP format. */ result = CPName_ConvertTo(to, - HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize) - result, + HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize) - result, newNameP->name); if (result < 0) { LOG(4, ("newName CP conversion failed\n")); @@ -1026,7 +1026,7 @@ retry: /* Convert new name to CP format. */ result = CPName_ConvertTo(to, - HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize) - result, + HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize) - result, newNameP->name); if (result < 0) { LOG(4, ("newName CP conversion failed\n")); @@ -1170,7 +1170,7 @@ HgfsPackSetattrRequest(const char *path, // IN: path to file requestV3->fileName.flags = 0; requestV3->reserved = 0; reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); - reqBufferSize = HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize); result = CPName_ConvertTo(path, reqBufferSize, requestV3->fileName.name); @@ -1228,7 +1228,7 @@ HgfsPackSetattrRequest(const char *path, // IN: path to file requestV2->hints = 0; reqSize = sizeof *requestV2; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, requestV2); + reqBufferSize = HGFS_NAME_BUFFER_SIZE(HgfsLargePacketMax(FALSE), requestV2); result = CPName_ConvertTo(path, reqBufferSize, requestV2->fileName.name); @@ -1278,7 +1278,7 @@ HgfsPackSetattrRequest(const char *path, // IN: path to file update = &request->update; reqSize = sizeof *request; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, request); + reqBufferSize = HGFS_NAME_BUFFER_SIZE(HgfsLargePacketMax(FALSE), request); result = CPName_ConvertTo(path, reqBufferSize, request->fileName.name); diff --git a/open-vm-tools/vmhgfs-fuse/filesystem.c b/open-vm-tools/vmhgfs-fuse/filesystem.c index fd5a0066b..96a3ce0d9 100644 --- a/open-vm-tools/vmhgfs-fuse/filesystem.c +++ b/open-vm-tools/vmhgfs-fuse/filesystem.c @@ -140,7 +140,7 @@ HgfsPackQueryVolumeRequest(const char *path, // IN: File pointer for this requestSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (requestSize - 1), + HgfsLargePacketMax(FALSE) - (requestSize - 1), requestV3->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); @@ -159,7 +159,7 @@ HgfsPackQueryVolumeRequest(const char *path, // IN: File pointer for this requestSize = sizeof *request; /* Convert to CP name. */ result = CPName_ConvertTo(path, - HGFS_LARGE_PACKET_MAX - (requestSize - 1), + HgfsLargePacketMax(FALSE) - (requestSize - 1), request->fileName.name); if (result < 0) { LOG(4, ("CP conversion failed.\n")); diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.c b/open-vm-tools/vmhgfs-fuse/fsutil.c index 4363ea36b..fe4e4e83a 100644 --- a/open-vm-tools/vmhgfs-fuse/fsutil.c +++ b/open-vm-tools/vmhgfs-fuse/fsutil.c @@ -113,7 +113,7 @@ HgfsUnpackGetattrReply(HgfsReq *req, // IN: Reply packet length = replyV3->symlinkTarget.length; /* Skip the symlinkTarget if it's too long. */ - if (length > HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, + if (length > HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), sizeof *replyV3 + sizeof (HgfsReply))) { LOG(4, ("symlink target name too long, ignoring\n")); return -ENAMETOOLONG; @@ -125,7 +125,7 @@ HgfsUnpackGetattrReply(HgfsReq *req, // IN: Reply packet length = replyV2->symlinkTarget.length; /* Skip the symlinkTarget if it's too long. */ - if (length > HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, replyV2)) { + if (length > HGFS_NAME_BUFFER_SIZE(HgfsLargePacketMax(FALSE), replyV2)) { LOG(4, ("symlink target name too long, ignoring\n")); return -ENAMETOOLONG; } @@ -208,7 +208,7 @@ HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer requestV3->reserved = 0; reqSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); - reqBufferSize = HGFS_NAME_BUFFER_SIZET(HGFS_LARGE_PACKET_MAX, reqSize); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(HgfsLargePacketMax(FALSE), reqSize); /* Convert to CP name. */ result = CPName_ConvertTo(path, @@ -232,7 +232,7 @@ HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer requestV2 = (HgfsRequestGetattrV2 *)(HGFS_REQ_PAYLOAD(req)); requestV2->hints = 0; reqSize = sizeof *requestV2; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, requestV2); + reqBufferSize = HGFS_NAME_BUFFER_SIZE(HgfsLargePacketMax(FALSE), requestV2); /* Convert to CP name. */ result = CPName_ConvertTo(path, @@ -252,7 +252,7 @@ HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer HgfsRequestGetattr *requestV1; requestV1 = (HgfsRequestGetattr *)(HGFS_REQ_PAYLOAD(req)); reqSize = sizeof *requestV1; - reqBufferSize = HGFS_NAME_BUFFER_SIZE(HGFS_LARGE_PACKET_MAX, requestV1); + reqBufferSize = HGFS_NAME_BUFFER_SIZE(HgfsLargePacketMax(FALSE), requestV1); /* Convert to CP name. */ result = CPName_ConvertTo(path, diff --git a/open-vm-tools/vmhgfs-fuse/link.c b/open-vm-tools/vmhgfs-fuse/link.c index 777eb76ea..3a6fc912c 100644 --- a/open-vm-tools/vmhgfs-fuse/link.c +++ b/open-vm-tools/vmhgfs-fuse/link.c @@ -69,7 +69,7 @@ HgfsPackSymlinkCreateRequest(const char* symlink, // IN: path of the link requestSize = sizeof(*requestV3) + HgfsGetRequestHeaderSize(); /* Convert symlink name to CP format. */ result = CPName_ConvertTo(symlink, - HGFS_LARGE_PACKET_MAX - (requestSize - 1), + HgfsLargePacketMax(FALSE) - (requestSize - 1), requestV3->symlinkName.name); if (result < 0) { LOG(4, ("SymlinkName CP conversion failed.\n")); @@ -79,7 +79,7 @@ HgfsPackSymlinkCreateRequest(const char* symlink, // IN: path of the link requestSize += result; /* Copy target name into request packet. */ - if (targetNameBytes > HGFS_LARGE_PACKET_MAX - (requestSize - 1)) { + if (targetNameBytes > HgfsLargePacketMax(FALSE) - (requestSize - 1)) { LOG(4, ("Target name is too long.\n")); return -EINVAL; } @@ -104,7 +104,7 @@ HgfsPackSymlinkCreateRequest(const char* symlink, // IN: path of the link requestSize = sizeof *request; /* Convert symlink name to CP format. */ result = CPName_ConvertTo(symlink, - HGFS_LARGE_PACKET_MAX - (requestSize - 1), + HgfsLargePacketMax(FALSE) - (requestSize - 1), request->symlinkName.name); if (result < 0) { LOG(4, ("SymlinkName CP conversion failed.\n")); @@ -114,7 +114,7 @@ HgfsPackSymlinkCreateRequest(const char* symlink, // IN: path of the link requestSize += result; /* Copy target name into request packet. */ - if (targetNameBytes > HGFS_LARGE_PACKET_MAX - (requestSize - 1)) { + if (targetNameBytes > HgfsLargePacketMax(FALSE) - (requestSize - 1)) { LOG(4, ("Target name is too long.\n")); return -EINVAL; } diff --git a/open-vm-tools/vmhgfs-fuse/request.c b/open-vm-tools/vmhgfs-fuse/request.c index 491cec90c..9481ccd86 100644 --- a/open-vm-tools/vmhgfs-fuse/request.c +++ b/open-vm-tools/vmhgfs-fuse/request.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013 VMware, Inc. All rights reserved. + * Copyright (C) 2013,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -311,7 +311,7 @@ HgfsSendRequest(HgfsReq *req) // IN/OUT: Outgoing request int ret; ASSERT(req); - ASSERT(req->payloadSize <= HGFS_LARGE_PACKET_MAX); + ASSERT(req->payloadSize <= HgfsLargePacketMax(FALSE)); req->state = HGFS_REQ_STATE_UNSENT; @@ -437,7 +437,7 @@ HgfsCompleteReq(HgfsReq *req, // IN: Request { ASSERT(req); ASSERT(reply); - ASSERT(replySize <= HGFS_LARGE_PACKET_MAX); + ASSERT(replySize <= HgfsLargePacketMax(FALSE)); memcpy(HGFS_REQ_PAYLOAD(req), reply, replySize); req->payloadSize = replySize; diff --git a/open-vm-tools/vmhgfs-fuse/session.c b/open-vm-tools/vmhgfs-fuse/session.c index 3fba65dbd..e4c156574 100644 --- a/open-vm-tools/vmhgfs-fuse/session.c +++ b/open-vm-tools/vmhgfs-fuse/session.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2015-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2015-2016,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -52,7 +52,7 @@ HgfsPackCreateSessionRequest(HgfsOp opUsed, // IN: Op to be used HgfsRequestCreateSessionV4 *requestV4 = HgfsGetRequestPayload(req); requestV4->numCapabilities = 0; - requestV4->maxPacketSize = HGFS_LARGE_PACKET_MAX; + requestV4->maxPacketSize = HgfsLargePacketMax(FALSE); requestV4->reserved = 0; req->payloadSize = sizeof(*requestV4) + HgfsGetRequestHeaderSize(); diff --git a/open-vm-tools/vmhgfs-fuse/transport.c b/open-vm-tools/vmhgfs-fuse/transport.c index 9f3f4325b..22fa5a070 100644 --- a/open-vm-tools/vmhgfs-fuse/transport.c +++ b/open-vm-tools/vmhgfs-fuse/transport.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2013 VMware, Inc. All rights reserved. + * Copyright (C) 2013,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -324,7 +324,7 @@ HgfsTransportSendRequest(HgfsReq *req) // IN: Request to send int ret; ASSERT(req); ASSERT(req->state == HGFS_REQ_STATE_UNSENT); - ASSERT(req->payloadSize <= HGFS_LARGE_PACKET_MAX); + ASSERT(req->payloadSize <= HgfsLargePacketMax(FALSE)); pthread_mutex_lock(&gHgfsActiveChannelLock); diff --git a/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h b/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h index f23d5d095..030b6916a 100644 --- a/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h +++ b/open-vm-tools/vmhgfs-fuse/vmhgfs_version.h @@ -25,8 +25,8 @@ #ifndef _VMHGFS_VERSION_H_ #define _VMHGFS_VERSION_H_ -#define VMHGFS_DRIVER_VERSION 1.6.9.0 -#define VMHGFS_DRIVER_VERSION_COMMAS 1,6,9,0 -#define VMHGFS_DRIVER_VERSION_STRING "1.6.9.0" +#define VMHGFS_DRIVER_VERSION 1.6.10.0 +#define VMHGFS_DRIVER_VERSION_COMMAS 1,6,10,0 +#define VMHGFS_DRIVER_VERSION_STRING "1.6.10.0" #endif /* _VMHGFS_VERSION_H_ */