platform: add NMPlatformLink.parent, sort link_get_all() output
Add a "parent" field to NMPlatformLink, giving the parent device ifindex for devices that have a parent. Make nm_platform_link_get_all() sort the links before returning them, so that masters appear after all of their slaves, and parent devices appear before their children. Remove the second call to nm_platform_query_devices() from NMManager since it is now guaranteed that an NMDeviceVLAN's parent NMDevice will have been created before the NMDeviceVLAN.
This commit is contained in:
@@ -543,6 +543,7 @@ link_init (NMPlatform *platform, NMPlatformLink *info, struct rtnl_link *rtnllin
|
||||
info->connected = !!(rtnl_link_get_flags (rtnllink) & IFF_LOWER_UP);
|
||||
info->arp = !(rtnl_link_get_flags (rtnllink) & IFF_NOARP);
|
||||
info->master = rtnl_link_get_master (rtnllink);
|
||||
info->parent = rtnl_link_get_link (rtnllink);
|
||||
info->mtu = rtnl_link_get_mtu (rtnllink);
|
||||
|
||||
udev_device = g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (info->ifindex));
|
||||
|
Reference in New Issue
Block a user