diff options
author | Dan Williams <dcbw@redhat.com> | 2015-03-24 12:46:18 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2015-03-27 15:11:34 -0500 |
commit | 99a620126448101a64515957c3882f3ea8ec9151 (patch) | |
tree | 81d5f08cd40ee9c5b2db4e96b8710f5b029099b1 /src/devices | |
parent | 25a286e999510a8abeb65c1c47cf28e22df649ec (diff) | |
download | NetworkManager-99a620126448101a64515957c3882f3ea8ec9151.tar.gz |
core: use dev_id when calculating the interface IPv6 IID (rh #1101809)
Some device types (s390 OSA and ipvlan) can use the same link-layer address
for multiple virtual interfaces, and the kernel used the dev_id property
to differentiate these devices when constructing the IID. NM should do
this too to prevent IID clashes.
https://bugzilla.redhat.com/show_bug.cgi?id=1101809
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/nm-device.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index ddc213c0a4..bf10abe6c5 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -201,6 +201,7 @@ typedef struct { char * hw_addr; guint hw_addr_len; char * physical_port_id; + guint dev_id; NMUnmanagedFlags unmanaged_flags; gboolean is_nm_owned; /* whether the device is a device owned and created by NM */ @@ -600,6 +601,7 @@ nm_device_set_ip_iface (NMDevice *self, const char *iface) static gboolean get_ip_iface_identifier (NMDevice *self, NMUtilsIPv6IfaceId *out_iid) { + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMLinkType link_type; const guint8 *hwaddr = NULL; size_t hwaddr_len = 0; @@ -620,6 +622,7 @@ get_ip_iface_identifier (NMDevice *self, NMUtilsIPv6IfaceId *out_iid) success = nm_utils_get_ipv6_interface_identifier (link_type, hwaddr, hwaddr_len, + priv->dev_id, out_iid); if (!success) { _LOGW (LOGD_HW, "failed to generate interface identifier " @@ -8472,6 +8475,7 @@ constructed (GObject *object) if (priv->ifindex > 0) { priv->is_software = nm_platform_link_is_software (priv->ifindex); priv->physical_port_id = nm_platform_link_get_physical_port_id (priv->ifindex); + priv->dev_id = nm_platform_link_get_dev_id (priv->ifindex); priv->mtu = nm_platform_link_get_mtu (priv->ifindex); } /* Indicate software device in capabilities. */ |