[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190320.111733.684046665730660576.davem@davemloft.net>
Date: Wed, 20 Mar 2019 11:17:33 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: jon.maloy@...csson.com
Cc: netdev@...r.kernel.org, gordan.mihaljevic@...tech.com.au,
tung.q.nguyen@...tech.com.au, hoang.h.le@...tech.com.au,
canh.d.luu@...tech.com.au, ying.xue@...driver.com,
tipc-discussion@...ts.sourceforge.net
Subject: Re: [net 1/1] tipc: fix cancellation of topology subscriptions
From: Jon Maloy <jon.maloy@...csson.com>
Date: Wed, 20 Mar 2019 10:59:03 +0100
> From: Erik Hugne <erik.hugne@...il.com>
>
> 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.
...
> diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c
> index 4a708a4..b05a89a 100644
> --- a/net/tipc/topsrv.c
> +++ b/net/tipc/topsrv.c
> @@ -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.
Powered by blists - more mailing lists