From patchwork Thu Nov 24 02:05:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Maloy X-Patchwork-Id: 698586 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tPN4y2x64z9t2C for ; Thu, 24 Nov 2016 13:12:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yahoo.com header.i=@yahoo.com header.b="P4mewjQD"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755226AbcKXCMO (ORCPT ); Wed, 23 Nov 2016 21:12:14 -0500 Received: from smtp102.biz.mail.bf1.yahoo.com ([98.139.221.61]:29278 "EHLO smtp102.biz.mail.bf1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754159AbcKXCMN (ORCPT ); Wed, 23 Nov 2016 21:12:13 -0500 Received: (qmail 96004 invoked from network); 24 Nov 2016 02:05:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1479953131; bh=gtKjZb6l/zzOjVzXa05+FVOz65Ln6flVSgC8Snx0t5k=; h=From:To:Cc:Subject:Date:Message-Id; b=P4mewjQDNss5Ah0Mrhg7Re1yJqbFmFTLubdEyJaqJqfWIvDlS3D6psoCuPIfjCD4cPcg8Xowg7UDyW/p8nlaq62TOg4cPOp6kCfauN9MxnMfCg9T9d5magtRUWy/OJ8kb+q0zdKzBYywtyUleYFsRRri2mDobSmhuau24ayoOW0= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 0e3XmA8VM1lozpeEIP8gdE0h11zEyd4tHF1m_KbJo8bfgez Q2Nkh3n28nNhwbmPHtBUK6xgwPI.yhAisdB7Eqp.ReYMOvZfs4ocRXhltVXk mA0Gb.QPmp3o4CVS.not9d5YPRR3_yEjy5Y1ZS_juUNdYRBOp5REcq6m6dU_ Xj5hcHsUr1eZN1manHVKR4gHCMoRAbnrIyLmT4.CQliiqDU40vY8L_xk40xw 0Lc.jCzTxw9GzZj0uJZ.fEi2G9ZRhADAR1APCjnp3dTG8D7A8bi3XN3X1nwq QffEN6nUrTWVx6uQ0ueCZYrShHCQ7uD7j3aG8JOWi1BWcZ1KU8haiRH.w9xp 7WUHYK0F54PoGtxjpAWF7oyaMIpuI.FJL3gvwAk7wdPLrkffuQKTW63llMU2 6mUWxHX9OwgE0SgcYfVGZuemdq6Ze9C.lF.t_IVIA14jqwsFN.QsClb7T61r 9pk2AYbcnoCaBEGuYq.bZjDFUSWfWzHDYfx.THzS3301oIhXGsFLd055auN1 j5j6_8l1g4XSBan.b3n4dDuoKeONAY2e2cFWvY1bQuhvFq0Y- X-Yahoo-SMTP: gPXIZm2swBAFQJ_Vx0CebjUfUdhJ From: Jon Maloy To: davem@davemloft.net Cc: netdev@vger.kernel.org, Amar Nv , parthasarathy.bhuvaragan@ericsson.com, ying.xue@windriver.com, maloy@donjonn.com, tipc-discussion@lists.sourceforge.net, Jon Maloy Subject: [PATCH net 1/1] tipc: fix compatibility bug in link monitoring Date: Wed, 23 Nov 2016 21:05:26 -0500 Message-Id: <1479953126-3552-1-git-send-email-jon.maloy@ericsson.com> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org commit 817298102b0b ("tipc: fix link priority propagation") introduced a compatibility problem between TIPC versions newer than Linux 4.6 and those older than Linux 4.4. In versions later than 4.4, link STATE messages only contain a non-zero link priority value when the sender wants the receiver to change its priority. This has the effect that the receiver resets itself in order to apply the new priority. This works well, and is consistent with the said commit. However, in versions older than 4.4 a valid link priority is present in all sent link STATE messages, leading to cyclic link establishment and reset on the 4.6+ node. We fix this by adding a test that the received value should not only be valid, but also differ from the current value in order to cause the receiving link endpoint to reset. Reported-by: Amar Nv Signed-off-by: Jon Maloy --- net/tipc/link.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index 1055164..ecc12411 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1492,8 +1492,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) l->tolerance = peers_tol; - if (peers_prio && in_range(peers_prio, TIPC_MIN_LINK_PRI, - TIPC_MAX_LINK_PRI)) { + /* Update own prio if peer indicates a different value */ + if ((peers_prio != l->priority) && + in_range(peers_prio, 1, TIPC_MAX_LINK_PRI)) { l->priority = peers_prio; rc = tipc_link_fsm_evt(l, LINK_FAILURE_EVT); }