From: VMware, Inc <> Date: Thu, 2 Aug 2012 05:21:40 +0000 (-0700) Subject: GuestInfo: ignore the extra NIC information X-Git-Tag: 2012.10.14-874563~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae64ea398410a1987831a8ee1b7441ab2e1bf326;p=thirdparty%2Fopen-vm-tools.git GuestInfo: ignore the extra NIC information If the total number of network interfaces configured for a VM exceeds the maximum XDR limit, then the guestInfo plugin crashes. GuestInfo plugin calls intf_loop() to retrieve the information about all the available interfaces. ReadInterfaceDetails() is passed as a callback function to intf_loop(). Add a check for the number of NICs processed and ignore the extra NIC information. By doing this, VMware Tools returns the maximum information that it could return and drops all the extra NIC info on the floor. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/services/plugins/guestInfo/getlib/guestInfoPosix.c b/open-vm-tools/services/plugins/guestInfo/getlib/guestInfoPosix.c index 9dd1dea03..f09908a29 100644 --- a/open-vm-tools/services/plugins/guestInfo/getlib/guestInfoPosix.c +++ b/open-vm-tools/services/plugins/guestInfo/getlib/guestInfoPosix.c @@ -289,7 +289,12 @@ ReadInterfaceDetails(const struct intf_entry *entry, // IN: current interface e Str_Sprintf(macAddress, sizeof macAddress, "%s", addr_ntoa(&entry->intf_link_addr)); nic = GuestInfoAddNicEntry(nicInfo, macAddress, NULL, NULL); - ASSERT_MEM_ALLOC(nic); + if (NULL == nic) { + /* + * We reached maximum number of NICs we can report to the host. + */ + return 0; + } /* Record the "primary" address. */ if (entry->intf_addr.addr_type == ADDR_TYPE_IP ||