Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD103C43381 for ; Wed, 20 Mar 2019 18:17:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9BDD218D4 for ; Wed, 20 Mar 2019 18:17:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727425AbfCTSRf (ORCPT ); Wed, 20 Mar 2019 14:17:35 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:38522 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726699AbfCTSRf (ORCPT ); Wed, 20 Mar 2019 14:17:35 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3A232148F8663; Wed, 20 Mar 2019 11:17:34 -0700 (PDT) Date: Wed, 20 Mar 2019 11:17:33 -0700 (PDT) Message-Id: <20190320.111733.684046665730660576.davem@davemloft.net> To: jon.maloy@ericsson.com Cc: netdev@vger.kernel.org, gordan.mihaljevic@dektech.com.au, tung.q.nguyen@dektech.com.au, hoang.h.le@dektech.com.au, canh.d.luu@dektech.com.au, ying.xue@windriver.com, tipc-discussion@lists.sourceforge.net Subject: Re: [net 1/1] tipc: fix cancellation of topology subscriptions From: David Miller In-Reply-To: <1553075943-15985-1-git-send-email-jon.maloy@ericsson.com> References: <1553075943-15985-1-git-send-email-jon.maloy@ericsson.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 20 Mar 2019 11:17:34 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jon Maloy Date: Wed, 20 Mar 2019 10:59:03 +0100 > From: Erik Hugne > > 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.