Skip to content
  • Thomas Haller's avatar
    device: add nm_device_get_ip_iface_from_platform() · f9077fa7
    Thomas Haller authored
    We have a cached nm_device_get_ip_iface() property. However, the interface
    name is not an identifier for a link because it can change at any time.
    
    Also, we already have the (ip) ifindex as proper identifier for the
    platform link. We shouldn't use two redundant identifiers to refer to
    a link.
    
    Clearly, sometimes we need an ifname. For example for ethtool ioctl or
    sysctl path names. For ethtool API, we resolve the actual name as late
    as possible, and for sysctl API we prefer NMP_SYSCTL_PATHID_NETDIR*().
    However, that is not always possible, for example for /proc/sys/net/ipv6/conf/
    sysctls.
    
    Add a function that resolves the ifname by looking into the cache. This
    of course is still racy, but it minimizes the time.
    
    Also, we should less and less rely on the ifname, and resolve it as late
    as possible. This patch adds a small wrapper going into that direction.
    f9077fa7