netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Alpe <richard.alpe@ericsson.com>
To: <netdev@vger.kernel.org>
Cc: <tipc-discussion@lists.sourceforge.net>,
	Richard Alpe <richard.alpe@ericsson.com>
Subject: [PATCH net-next v1 2/2] tipc: fix link priority propagation
Date: Mon, 1 Feb 2016 08:19:57 +0100	[thread overview]
Message-ID: <1454311197-10948-2-git-send-email-richard.alpe@ericsson.com> (raw)
In-Reply-To: <1454311197-10948-1-git-send-email-richard.alpe@ericsson.com>

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>
---
 net/tipc/link.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index f156353..6f4a6d9 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -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))
-- 
2.1.4

  reply	other threads:[~2016-02-01  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  7:19 [PATCH net-next v1 1/2] tipc: fix link attribute propagation bug Richard Alpe
2016-02-01  7:19 ` Richard Alpe [this message]
2016-02-06  7:46   ` [PATCH net-next v1 2/2] tipc: fix link priority propagation David Miller
2016-02-06  7:45 ` [PATCH net-next v1 1/2] tipc: fix link attribute propagation bug David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454311197-10948-2-git-send-email-richard.alpe@ericsson.com \
    --to=richard.alpe@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).