]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
Fix the missing IP aliases in the guest info.
authorOliver Kurth <okurth@vmware.com>
Tue, 19 Feb 2019 20:51:32 +0000 (12:51 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 19 Feb 2019 20:51:32 +0000 (12:51 -0800)
commit364684e1ce5fba483682f91c7fc27ee0fdcc2a93
tree3a2973c429c09a3ef6b633e6abcf6a47ddbd9603
parent47943dec30e3b98259c1dc0d48fb4f669fb02e99
Fix the missing IP aliases in the guest info.

IP aliases were missing in the guest info when libdnet is not used.

Previously tried to use the MAC address as the key to identify the IP aliases
on Linux.  However, that didn't work for vlan devices which share the same
MAC as the parent NIC.  The previous attempt was backed out.

Ideally, need to find a way to map the label name to the NIC name, but
have not been able to find a simple solution for this.  There might be a
netlink based solution but it is way too costly to do.

After more investigation, found out that a valid IP alias name must start
with the original NIC name followed by a colon.  Even though the ip addr allows
any string as the start of the NIC name, configuration file requires the colon.
In addition, ifconfig would error out when the name is not of the standard:
  ens192wwwww: error fetching interface information: Device not found

Therefore, a correctly configured system should use eth0:1, ens192:2 etc.

A lookup of libdnet source revealed the same assumption in the libdnet code.

/* Get addresses for this interface. */
for (ifr = intf->ifc.ifc_req; ifr < lifr && (ap + 1) < lap;
ifr = NEXTIFR(ifr)) {
/* XXX - Linux, Solaris ifaliases */
if ((p = strchr(ifr->ifr_name, ':')) != NULL)
*p = '\0';

Therefore, doing just the same.  Look for the colon, then trim it, and then
compare it with the NIC name.
open-vm-tools/lib/nicInfo/nicInfoPosix.c