Skip to content

Commit f796755

Browse files
Jon Paul Maloydavem330
authored andcommitted
tipc: fix compatibility bug in link monitoring
commit 8172981 ("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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 97db8af commit f796755

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

net/tipc/link.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,9 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
14921492
if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL))
14931493
l->tolerance = peers_tol;
14941494

1495-
if (peers_prio && in_range(peers_prio, TIPC_MIN_LINK_PRI,
1496-
TIPC_MAX_LINK_PRI)) {
1495+
/* Update own prio if peer indicates a different value */
1496+
if ((peers_prio != l->priority) &&
1497+
in_range(peers_prio, 1, TIPC_MAX_LINK_PRI)) {
14971498
l->priority = peers_prio;
14981499
rc = tipc_link_fsm_evt(l, LINK_FAILURE_EVT);
14991500
}

0 commit comments

Comments
 (0)