aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorErik Hugne <erik.hugne@ericsson.com>2014-03-06 08:40:19 -0500
committerDavid S. Miller <davem@davemloft.net>2014-03-06 14:46:23 -0500
commitedcc0511b5ee7235282a688cd604e3ae7f9e1fc9 (patch)
tree08ca164fb87ec0848efef992466a08d6469bbb8b /net
parentfe8e4649397915cf3b2ab0b695929a27e543967e (diff)
tipc: drop subscriber connection id invalidation
When a topology server subscriber is disconnected, the associated connection id is set to zero. A check vs zero is then done in the subscription timeout function to see if the subscriber have been shut down. This is unnecessary, because all subscription timers will be cancelled when a subscriber terminates. Setting the connection id to zero is actually harmful because id zero is the identity of the topology server listening socket, and can cause a race that leads to this socket being closed instead. Signed-off-by: Erik Hugne <erik.hugne@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/subscr.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c
index a6ce3bbf3eaf..11c9ae00837d 100644
--- a/net/tipc/subscr.c
+++ b/net/tipc/subscr.c
@@ -149,14 +149,6 @@ static void subscr_timeout(struct tipc_subscription *sub)
149 /* The spin lock per subscriber is used to protect its members */ 149 /* The spin lock per subscriber is used to protect its members */
150 spin_lock_bh(&subscriber->lock); 150 spin_lock_bh(&subscriber->lock);
151 151
152 /* Validate if the connection related to the subscriber is
153 * closed (in case subscriber is terminating)
154 */
155 if (subscriber->conid == 0) {
156 spin_unlock_bh(&subscriber->lock);
157 return;
158 }
159
160 /* Validate timeout (in case subscription is being cancelled) */ 152 /* Validate timeout (in case subscription is being cancelled) */
161 if (sub->timeout == TIPC_WAIT_FOREVER) { 153 if (sub->timeout == TIPC_WAIT_FOREVER) {
162 spin_unlock_bh(&subscriber->lock); 154 spin_unlock_bh(&subscriber->lock);
@@ -211,9 +203,6 @@ static void subscr_release(struct tipc_subscriber *subscriber)
211 203
212 spin_lock_bh(&subscriber->lock); 204 spin_lock_bh(&subscriber->lock);
213 205
214 /* Invalidate subscriber reference */
215 subscriber->conid = 0;
216
217 /* Destroy any existing subscriptions for subscriber */ 206 /* Destroy any existing subscriptions for subscriber */
218 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list, 207 list_for_each_entry_safe(sub, sub_temp, &subscriber->subscription_list,
219 subscription_list) { 208 subscription_list) {