]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: feed tipc sock pointer to tipc_sk_timeout routine
authorYing Xue <ying.xue@windriver.com>
Fri, 9 Jan 2015 07:27:02 +0000 (15:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Jan 2015 21:24:32 +0000 (16:24 -0500)
commitdcfa0d00a6e995c7758c8ff03dc7a0e3187ed91e
tree38c93810ecd5f8783e186dad1d43fd27aeb02aeb
parent2525d7e2f651ad46b75e924fe040477780a50bd4
tipc: feed tipc sock pointer to tipc_sk_timeout routine

In order to make tipc socket table aware of namespace, a networking
namespace instance must be passed to tipc_sk_lookup(), allowing it
to look up tipc socket instance with a given port ID from a concrete
socket table. However, as now tipc_sk_timeout() only has one port ID
parameter and is not namespace aware, it's unable to obtain a correct
socket instance through tipc_sk_lookup() just with a port ID,
especially after namespace is completely supported.

If port ID is replaced with socket instance as tipc_sk_timeout()'s
parameter, it's unnecessary to look up socket table. But as the timer
handler - tipc_sk_timeout() is run asynchronously, socket reference
must be held before its timer is launched, and must be carefully
checked to identify whether the socket reference needs to be put or
not when its timer is terminated.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Tested-by: Tero Aho <Tero.Aho@coriant.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c