Skip to contentSkip to conversation

tipc: fix cancellation of topology subscriptions

PATCH In review Jon Maloy 2 participants 2 messages Mar 21, 2019

Subsystems (3)
lore
Share & tools
lore

Jon Maloy

author
#0 lore raw

PATCH v2 1/1 tipc: fix cancellation of topology subscriptions

From: Erik Hugne <[email protected]>

When cancelling a subscription, we have to clear the cancel bit in the request before iterating over any established subscriptions with memcmp. Otherwise no subscription will ever be found, and it will not be possible to explicitly unsubscribe individual subscriptions.

Fixes 8985ecc7c1e0 ("tipc: simplify endianness handling in topology subscriber")

---
v2: clear bit in a more sensible way.. (comment from davem)

---
 net/tipc/topsrv.c | 1 +
 1 file changed, 1 insertion(+)
net/tipc/topsrv.c +1 -0
index 4a708a4..b45932d7 100644
@@ -363,6 +363,7 @@ static int tipc_conn_rcv_sub(struct tipc_topsrv *srv,
 	struct tipc_subscription *sub;
 
 	if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) {
+		s->filter &= __constant_ntohl(~TIPC_SUB_CANCEL);
 		tipc_conn_delete_sub(con, s);
 		return 0;
 	}
Signature · 1 line
2.1.4
maintainer
#1 lore raw

From: Jon Maloy <[email protected]>
Date: Thu, 21 Mar 2019 09:11:59 +0100

Quoted 7 lines

From: Erik Hugne <[email protected]>

When cancelling a subscription, we have to clear the cancel bit in the request before iterating over any established subscriptions with memcmp. Otherwise no subscription will ever be found, and it will not be possible to explicitly unsubscribe individual subscriptions.

Quoted 6 lines
Fixes 8985ecc7c1e0 ("tipc: simplify endianness handling in topology subscriber")

---
v2: clear bit in a more sensible way.. (comment from davem)

Applied and queued up for -stable.

Thanks for following up.