On 6/05/10 08:17 PM, Peter Memishian wrote:
> > That sounds like a datalink, not an interface. Given that the protocol > > family is PF_INET/PF_INET6, it seems like the namespace should be objects > > in that namespace -- i.e., IPv4 and IPv6 interfaces, not datalinks. (Note > > that it is possible (though certainly not recommended) to have a datalink > > named foo0 and an interface named foo0 that have no relationship to one > > another.) > > I'm not sure that I understand what you're trying to say. I presume you're asking about the disjoint namespaces. Since IP interfaces are not necessarily instantiated from datalinks (e.g., vni(7D), loopback, and IPMP interfaces all exist only at the IP layer), there may be dormant datalinks with the same name. For instance, someone might create an IPMP interface named foo0 and may also have an unplumbed datalink named foo0 that has nothing do with that IPMP interface. If the admin has no need to use the datalink named foo0 for IP traffic, the two foo0's peacefully coexist. However, a PF_INET SIOCGIFHWADDR for foo0 unambiguously refers to the only IP object with that name (the IPMP interface), not the foo0 datalink that's unused. It seems like what you've proposed will erroneously return the hardware address for foo0 in this case. Note that this issue is particular to PF_INET/PF_INET6 -- other protocol families (e.g., PF_PACKET) are free to define the namespace associated wieth their objects -- which may well be datalinks.
In this case, a SIOCGIFHWADDR on foo0 for PF_INET will return details for the IPMP interface (i.e. an error because there is no such thing as a hardware address for an IPMP interface). A SIOCGIFHWADDR on foo0 for PF_PACKET would return the hardware address associated with the physical interface that was rename to foo0. If an IP network interface could exist, without it having a datalink behind it, and have a physical address associated with it, then that would be returned. Whether or not that makes sense, is another matter and is not the subject of this case. I think the correct summary is: For PF_INET/PF_INET6, IP network interfaces are used. If no hardware address is available with the IP network interface then an error is returned. (This is what I meant by "it must be at least plumb'd", although perhaps that implied a datalink was involved when that isn't necessarily the case.) For PF_PACKET, datalinks are used and the primary unicast MAC address is returned. (There is no scope within this ioctl, as it is currently defined, for anything else to be returned.) Darren _______________________________________________ opensolaris-arc mailing list [email protected]
