netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] tipc: fix compatibility bug in link monitoring
@ 2016-11-24  2:05 Jon Maloy
  2016-11-26  1:06 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Maloy @ 2016-11-24  2:05 UTC (permalink / raw)
  To: davem; +Cc: Jon Maloy, netdev, tipc-discussion

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 <amar.nv005@gmail.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
 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);
 		}
-- 
2.7.4


------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net 1/1] tipc: fix compatibility bug in link monitoring
  2016-11-24  2:05 [PATCH net 1/1] tipc: fix compatibility bug in link monitoring Jon Maloy
@ 2016-11-26  1:06 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-11-26  1:06 UTC (permalink / raw)
  To: jon.maloy
  Cc: netdev, amar.nv005, parthasarathy.bhuvaragan, ying.xue, maloy,
	tipc-discussion

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Wed, 23 Nov 2016 21:05:26 -0500

> 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 <amar.nv005@gmail.com>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-26  1:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24  2:05 [PATCH net 1/1] tipc: fix compatibility bug in link monitoring Jon Maloy
2016-11-26  1:06 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).