I am using Netlink to create a network interface without specifying the name. Netlink chooses a name for the new interface (like for example "vlan0"), but I do not know how to figure this name out.
My function calls are (in pseudo code):
link = rtnl_link_alloc();
rtnl_link_set_type(link, kind));
rtnl_link_add(sk, link, NLM_F_CREATE));
The interface is created without errors but calling rtnl_link_get_name(link)
or rtnl_link_get_ifindex(link)
but fail after the call to rtnl_link_add()
.
So how can I determine the name of the new interface?