aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <Allan.Stephens@windriver.com>2011-02-28 15:30:20 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-03-13 16:35:18 -0400
commit75f0aa49908992dbeb75710b72cbedb5cff9680f (patch)
tree993ef6601c10793db29538c681fccd86aa08172d /net/tipc
parent77f167fcce4d2ea144d92891d1e0fc0c50554082 (diff)
tipc: Fix redundant link field handling in link protocol message
Ensures that the "redundant link exists" field of the LINK_PROTOCOL messages sent by a link endpoint is set if and only if the sending node has at least one other working link to the peer node. Previously, the bit was set only if there were at least 2 working links to the peer node, meaning the bit was incorrectly left unset in messages sent by a non-working link endpoint when exactly one alternate working link was available. The revised code now takes the state of the link sending the message into account when deciding if an alternate link exists. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 6ffae0e8809e..e5f96d5ef1ad 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1898,6 +1898,7 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
1898 struct sk_buff *buf = NULL; 1898 struct sk_buff *buf = NULL;
1899 struct tipc_msg *msg = l_ptr->pmsg; 1899 struct tipc_msg *msg = l_ptr->pmsg;
1900 u32 msg_size = sizeof(l_ptr->proto_msg); 1900 u32 msg_size = sizeof(l_ptr->proto_msg);
1901 int r_flag;
1901 1902
1902 if (link_blocked(l_ptr)) 1903 if (link_blocked(l_ptr))
1903 return; 1904 return;
@@ -1954,7 +1955,8 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
1954 msg_set_max_pkt(msg, l_ptr->max_pkt_target); 1955 msg_set_max_pkt(msg, l_ptr->max_pkt_target);
1955 } 1956 }
1956 1957
1957 msg_set_redundant_link(msg, tipc_node_redundant_links(l_ptr->owner)); 1958 r_flag = (l_ptr->owner->working_links > tipc_link_is_up(l_ptr));
1959 msg_set_redundant_link(msg, r_flag);
1958 msg_set_linkprio(msg, l_ptr->priority); 1960 msg_set_linkprio(msg, l_ptr->priority);
1959 1961
1960 /* Ensure sequence number will not fit : */ 1962 /* Ensure sequence number will not fit : */