Add IPv6 addresses to Dbus

Checking if the interface name is not the same as the previous is based
upon the assumption that your list of interface names (ifa->ifa_name) will
always come back in sorted order of the interface they belong to, i.e.

eth0:
  169.172.0.1
  128.42.38.7
eth1:
  14.243.48.103
  fe80::740:61ff:fe74:3eb2

This assumption is wrong since the IP address can come in any order they
please, i.e.

eth0:
  169.172.0.1
eth1:
  fe80::740:61ff:fe74:3eb2
eth0:
  128.42.38.7
eth1:
  14.243.48.103

The if condition I removed is looking to see if the interface name is not
equal to the previous interface name, where it would assume it was
rolling over to the next free interface, always leaving you with the
last valid IP in the interface. In my case it was leaving me with only
IPv4 addresses and not including IPv6 addresses.

Tested By: Resetting my network to factory defaults, checking DBUS for
all ipv6 addresses:
dbus-send --system  \
    --print-reply \
    --dest=xyz.openbmc_project.Network \
    /xyz/openbmc_project/network/eth0/ipv6\
    org.freedesktop.DBus.Introspectable.Introspect

Adding an IPv6 Address:
dbus-send --system  \
    --dest=xyz.openbmc_project.Network \
    --type=method_call \
    --print-reply   \
    /xyz/openbmc_project/network/eth0 \
    xyz.openbmc_project.Network.IP.Create.IP \
string:"xyz.openbmc_project.Network.IP.Protocol.IPv6" \
string:"2002:1001:1001:1001:1001:1001:1001:1006" byte:10 \
string:"1001:1001:1001:1001:1001:1001:1001:1001" \

Validating the static IPv6 address appeared by the initial introspect command.

Change-Id: I3b85cecded696c251028accb28448f6e53bd9a7f
Signed-off-by: David Cobbley <david.j.cobbley@linux.intel.com>
1 file changed