[email protected] wrote:
On (04/28/09 15:31), Anders Persson wrote:
Hi Folks,

As most of you already know, if_nameindex(3SOCKET) and
if_indextoname(3SOCKET) will only return physical device names. It
also appears that some applications expect that the interface names
obtained using the API will be usable for issuing lifreq ioctls.
However, if you are using the API in a non-global zone that only has
logical interfaces, things break down as the zone cannot issue ioctls
on interfaces that are not in the zone (so
if_nametoindex(if_indextoname(1)) == 0 :-).

What do you guys think about the idea of changing if_nameindex() and
if_indextoname() such that they return logical names when the
physical ones are not accessible?


I'm not sure this is a good idea, esp in the world where we
are trying to hide logical interfaces as an implementation detail.

Agreed.

having nametoindex and indextoname return logical interface names
is also not sufficient if there are  multiple logical interfaces/addresses
in the zone (happens easily in the global zone) and then the app
has to do GLIFCONF to find the actual logical interface name. Why isn't it possible to modify the ioctls themselves to accept "net0" if there is some ipif "net0:K" whose zoneid is in the current zone, and as long as the rest of the ioctl data doesn't refer to "net0:J" that is not the current zone?

That makes more sense than exposing the :N names to the application.

I think we only need to do this for SIOCGLIFINDEX, but it probably makes sense to have a generic mechanism in the kernel with some new IPI flag which allows a match on net0 even though the net0:0 ipif doesn't match the zoneid.

That might be useful if we want to have a more clear separation between the phyint flags and the address flags down the road.

   Erik
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to