From: John Wolfe Date: Tue, 4 May 2021 02:39:40 +0000 (-0700) Subject: Format the VMCI port in a guest RPC connect request using "unsigned int" type. X-Git-Tag: stable-11.3.0~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=306366fa79a390b632c89b4eab29fdd01659b688;p=thirdparty%2Fopen-vm-tools.git Format the VMCI port in a guest RPC connect request using "unsigned int" type. --- diff --git a/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c b/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c index 51b3c1c2b..9b6fb80a6 100644 --- a/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c +++ b/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2019-2020 VMware, Inc. All rights reserved. + * Copyright (C) 2019-2021 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 @@ -961,7 +961,7 @@ SendConnectRequestToVmx(void) #else socklen_t addrLen = (socklen_t)sizeof(addr); #endif - char msg[32]; + char msg[32]; // Longest string: "guestStore.connect 4294967295" (29 chars) int msgLen; char *result; size_t resultLen; @@ -993,7 +993,7 @@ SendConnectRequestToVmx(void) } msgLen = Str_Sprintf(msg, sizeof msg, - "guestStore.connect %d", addr.svm_port); + "guestStore.connect %u", addr.svm_port); result = NULL; rpcChannelType = RpcChannel_GetType(pluginData.ctx->rpc); g_debug("Current guest RPC channel type: %d.\n", rpcChannelType); @@ -1015,9 +1015,10 @@ SendConnectRequestToVmx(void) } if (retVal) { - g_info("Connect request sent to VMX.\n"); + g_info("Connect request sent to VMX (svm_port = %u).\n", addr.svm_port); } else { - g_warning("Failed to send connect request to VMX: %s.\n", + g_warning("Failed to send connect request to VMX (svm_port = %u): %s.\n", + addr.svm_port, result != NULL ? result : ""); } vm_free(result);