• Thomas Graf's avatar
    [RTNETLINK]: Link attribute modification by interface name. · dcc994b3
    Thomas Graf authored
    This patch allows modification of link attributes by the interface name,
    avoids the requirement of translating a name to an ifindex first, and
    provides better atomicity to userspace.  It works by setting the ifindex
    to a negative number and provide the interface name via the IFLA_IFNAME
    TLV and let the kernel lookup the device by name instead of ifindex. Changing
    the interface name will not work using this method because IFLA_IFNAME also
    transports the new interface name.  The patch also fixes a possible source for
    bugs if IFNAMSIZ is ever changed to a number not aligned to RTA_ALIGNTO.
    Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    dcc994b3
rtnetlink.c 15.8 KB