]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
GuestInfo: ignore the extra NIC information
authorVMware, Inc <>
Thu, 2 Aug 2012 05:21:40 +0000 (22:21 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Thu, 2 Aug 2012 18:01:11 +0000 (11:01 -0700)
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 <dtor@vmware.com>
open-vm-tools/services/plugins/guestInfo/getlib/guestInfoPosix.c

index 9dd1dea03f71f0ae8ed8c4551e9fa009f1c81354..f09908a29c3b0aafb29ee7656de907c393213c69 100644 (file)
@@ -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 ||