[openib-general][PATCH] local device search with source address wildcard

Sean Hefty mshefty at ichips.intel.com
Fri Nov 4 09:36:16 PST 2005


Tom Tucker wrote:
> Sean:
> 
> I was looking through ip_resolve_local and it looks to me like
> if the source address is 0, it will end up getting set to the 
> destination IP instead of the IP address of the local interface.

The intent of ip_resolve_local() is to check if a given destination address is 
on the local system.  If it is and no source address is specified, then the 
source address is set to the same address as the destination.

> Also if ip_dev_find can't find a local interface with connectivity 
> to the specified remote peer, shouldn't the error be EHOSTUNREACH?

If the address is not a local address, then a check is made to find a route to 
that address assuming that it exists somewhere remotely.  See ib_resolve_addr() 
which calls ip_resolve_local() and ip_resolve_remote().  So, the return code 
from ip_resolve_local() returns that the given address is not available on the 
local system.  The address may still be reachable as a remote address.

> Finally, if the user specifies a bogus source address, we don't 
> compare it against the source address configured on the local 
> interface found in the route. It will probably still fail later, 
> but in some bizarre fashion.

If the source address is bogus, then the call to ib_translate_addr() will fail 
with EADDRNOTAVAIL.

I'm not tied to the return codes, so if one of them works better than the other, 
I can change it.

- Sean



More information about the general mailing list