diff options
author | Ying Xue <ying.xue@windriver.com> | 2015-03-17 21:32:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-17 22:11:26 -0400 |
commit | 2b9bb7f338502d9d01543daa9fdf4a7f104bd572 (patch) | |
tree | 63ae1de352f41570ea39d5fa5dd2c2dff5696dc6 /net/tipc | |
parent | 8460504bdd9aa5996dfc5dd69cd61582a25139ec (diff) |
tipc: withdraw tipc topology server name when namespace is deleted
The TIPC topology server is a per namespace service associated with the
tipc name {1, 1}. When a namespace is deleted, that name must be withdrawn
before we call sk_release_kernel because the kernel socket release is
done in init_net and trying to withdraw a TIPC name published in another
namespace will fail with an error as:
[ 170.093264] Unable to remove local publication
[ 170.093264] (type=1, lower=1, ref=2184244004, key=2184244005)
We fix this by breaking the association between the topology server name
and socket before calling sk_release_kernel.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/server.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/server.c b/net/tipc/server.c index a57c8407cbf3..ab6183cdb121 100644 --- a/net/tipc/server.c +++ b/net/tipc/server.c | |||
@@ -90,6 +90,7 @@ static void tipc_clean_outqueues(struct tipc_conn *con); | |||
90 | static void tipc_conn_kref_release(struct kref *kref) | 90 | static void tipc_conn_kref_release(struct kref *kref) |
91 | { | 91 | { |
92 | struct tipc_conn *con = container_of(kref, struct tipc_conn, kref); | 92 | struct tipc_conn *con = container_of(kref, struct tipc_conn, kref); |
93 | struct sockaddr_tipc *saddr = con->server->saddr; | ||
93 | struct socket *sock = con->sock; | 94 | struct socket *sock = con->sock; |
94 | struct sock *sk; | 95 | struct sock *sk; |
95 | 96 | ||
@@ -99,6 +100,8 @@ static void tipc_conn_kref_release(struct kref *kref) | |||
99 | __module_get(sock->ops->owner); | 100 | __module_get(sock->ops->owner); |
100 | __module_get(sk->sk_prot_creator->owner); | 101 | __module_get(sk->sk_prot_creator->owner); |
101 | } | 102 | } |
103 | saddr->scope = -TIPC_NODE_SCOPE; | ||
104 | kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr)); | ||
102 | sk_release_kernel(sk); | 105 | sk_release_kernel(sk); |
103 | con->sock = NULL; | 106 | con->sock = NULL; |
104 | } | 107 | } |