platform: add inet6_addr_get_mode_inv parameter to NMPlatformLink

This commit is contained in:
Thomas Haller
2015-04-27 18:32:43 +02:00
parent 36e77218a0
commit 5b2b62ff51
3 changed files with 15 additions and 0 deletions

View File

@@ -964,6 +964,15 @@ init_link (NMPlatform *platform, NMPlatformLink *info, struct rtnl_link *rtnllin
} }
} }
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
if (_support_user_ipv6ll_get ()) {
guint8 mode = 0;
if (rtnl_link_inet6_get_addr_gen_mode (rtnllink, &mode) == 0)
info->inet6_addr_gen_mode_inv = ~mode;
}
#endif
udev_device = g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (info->ifindex)); udev_device = g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (info->ifindex));
if (udev_device) { if (udev_device) {
info->driver = nmp_utils_udev_get_driver (udev_device); info->driver = nmp_utils_udev_get_driver (udev_device);

View File

@@ -2794,6 +2794,7 @@ nm_platform_link_cmp (const NMPlatformLink *a, const NMPlatformLink *b)
_CMP_FIELD (a, b, mtu); _CMP_FIELD (a, b, mtu);
_CMP_FIELD_BOOL (a, b, initialized); _CMP_FIELD_BOOL (a, b, initialized);
_CMP_FIELD (a, b, addr.len); _CMP_FIELD (a, b, addr.len);
_CMP_FIELD (a, b, inet6_addr_gen_mode_inv);
_CMP_FIELD_STR_INTERNED (a, b, kind); _CMP_FIELD_STR_INTERNED (a, b, kind);
_CMP_FIELD_STR0 (a, b, udi); _CMP_FIELD_STR0 (a, b, udi);
_CMP_FIELD_STR_INTERNED (a, b, driver); _CMP_FIELD_STR_INTERNED (a, b, driver);

View File

@@ -107,6 +107,11 @@ struct _NMPlatformLink {
guint8 len; guint8 len;
} addr; } addr;
/* The bitwise inverse of rtnl_link_inet6_get_addr_gen_mode(). It is inverse
* to have a default of 0 -- meaning: unspecified. That way, a struct
* initialized with memset(0) has and unset value.*/
guint8 inet6_addr_gen_mode_inv;
/* rtnl_link_vlan_get_id(), IFLA_VLAN_ID */ /* rtnl_link_vlan_get_id(), IFLA_VLAN_ID */
guint16 vlan_id; guint16 vlan_id;