[openib-general] Re: 2.6.14 heads up: ip_dev_find() not exported

Hal Rosenstock halr at voltaire.com
Tue Sep 27 03:33:24 PDT 2005


On Mon, 2005-09-26 at 10:41, Michael S. Tsirkin wrote: 
> If ip_route_output_key resolves to a loopback device,
> sdp uses ip_dev_find to try and locate the actual hardware device
> that the source ip address is for.

Right, and if that device (returned by ip_dev_find) is the loopback
device, it just finds the first IPoIB device which is available. That's
right for when actual IP addresses are used but what about a local IPoIB
address. Shouldn't the actual IPoIB device be used for that ? Or doesn't
this matter ?

I also think there may be another case broken here which might be more
serious: that's if an IP address of a local ethernet address is used
(other IP interface types too). I think that the hardware type of the
interface selected by the route lookup needs to be verified in the non
loopback case and if not IPoIB some IPoIB interface (see above) needs to
be selected. If you agree, I will cook up a patch for this.

> Do you know of a better way to do this?

Not sure better but one way might be to:
walk the netdevices and match on IP address of the interface (but I
don't see any easy way to do that).

I think we might want to tell them to add the export of this back in.
Was it only removed because no one outside that module used this or that
the use of it outside the module is bad ?

> I think we could get by with just dev_get_by_index, I'll have to
> investigate this.

How would that work ? Don't we want to move away from using this routine
unless we already have the index in hand.

-- Hal




More information about the general mailing list