tipc: fix link priority propagation
authorRichard Alpe <richard.alpe@ericsson.com>
Mon, 1 Feb 2016 07:19:57 +0000 (08:19 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Feb 2016 07:45:38 +0000 (02:45 -0500)
Currently link priority changes isn't handled for active links. In
this patch we resolve this by changing our priority if the peer passes
a valid priority in a state message.

Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c

index f1563539157654709c6daca45055a0a977c63209..6f4a6d9b014989f29ff378d3e84cb60fd809aabe 100644 (file)
@@ -1458,6 +1458,12 @@ 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)) {
+                       l->priority = peers_prio;
+                       rc = tipc_link_fsm_evt(l, LINK_FAILURE_EVT);
+               }
+
                l->silent_intv_cnt = 0;
                l->stats.recv_states++;
                if (msg_probe(hdr))