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>
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 ||