Whamcloud - gitweb
LU-10391 socklnd: use interface index to track local addr
socklnd currently uses local IP addresses to track the local end of a
route or connection. This will not work so well for IPv6 where
addresses are generally more dynamic - an interface can have several
addresses and they can come and go.
Even with IPv4, an interface can have multple addresses, though this
is partially hidden as there we normally use aliases which make it
looks like different interfaces: eth0:1 eth0:2 etc. These are really
all the same interface, just with different addresses.
It is really the local interface, rather than the local address,
which is important. Choosing the right interface ensures the traffic
goes over the desired network hardware. Using an address, as the code
currently does, is just a convenient indirection.
With IPv6, using the interface directly will be easier, and it is
quite possible with IPv4.
So: this patch changes ksock_route to store an interface index for the
source end of the route, and adds the index nubmer to ksock_interface.
lnet_sock_listen() loses the local IP address which is never used, and
lnet_sock_connect() now is passed a source interface rather than a
source IP address.
lock_sock_create() also gets a local source interface.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ib3e0f92d10ad6ba4d66782bae22638e9935a1e4e
Reviewed-on: https://review.whamcloud.com/37702
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>