tipc: fix cancellation of topology subscriptions
Subsystems (3)
PATCH 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.
--- net/tipc/topsrv.c | 1 + 1 file changed, 1 insertion(+)
net/tipc/topsrv.c +1 -0
@@ -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
David Miller
maintainerFrom: Jon Maloy <[email protected]>
Date: Wed, 20 Mar 2019 10:59:03 +0100
Quoted 6 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.
...
net/tipc/topsrv.c static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, · line 367
Quoted 10 lines
net/tipc/topsrv.c +1
-0@@ -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);
It is confusing to say we have to "clear" some bit in a certain situation and then use a xor operation which "inverts" a bit.
Please use "&= ~VAL" instead.
Thank you.