aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-10-10 11:34:01 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-11 01:56:07 -0400
commit047491ea334a454fa0647ec99dadcc6dd38417e0 (patch)
tree471f0d373176ce08fdc075c8e526e38263de27b1 /net/tipc
parent28b6bfebdd2fde5e09aa830bbeb284ec96c2c0a0 (diff)
tipc: set link tolerance correctly in broadcast link
In the patch referred to below we added link tolerance as an additional criteria for declaring broadcast transmission "stale" and resetting the affected links. However, the 'tolerance' field of the broadcast link is never set, and remains at zero. This renders the whole commit without the intended improving effect, but luckily also with no negative effect. In this commit we add the missing initialization. Fixes: a4dc70d46cf1 ("tipc: extend link reset criteria for stale packet retransmission") Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/link.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index fb886b525d95..d229a36968da 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -477,6 +477,8 @@ bool tipc_link_create(struct net *net, char *if_name, int bearer_id,
477 l->in_session = false; 477 l->in_session = false;
478 l->bearer_id = bearer_id; 478 l->bearer_id = bearer_id;
479 l->tolerance = tolerance; 479 l->tolerance = tolerance;
480 if (bc_rcvlink)
481 bc_rcvlink->tolerance = tolerance;
480 l->net_plane = net_plane; 482 l->net_plane = net_plane;
481 l->advertised_mtu = mtu; 483 l->advertised_mtu = mtu;
482 l->mtu = mtu; 484 l->mtu = mtu;
@@ -1031,7 +1033,7 @@ static int tipc_link_retrans(struct tipc_link *l, struct tipc_link *r,
1031 /* Detect repeated retransmit failures on same packet */ 1033 /* Detect repeated retransmit failures on same packet */
1032 if (r->last_retransm != buf_seqno(skb)) { 1034 if (r->last_retransm != buf_seqno(skb)) {
1033 r->last_retransm = buf_seqno(skb); 1035 r->last_retransm = buf_seqno(skb);
1034 r->stale_limit = jiffies + msecs_to_jiffies(l->tolerance); 1036 r->stale_limit = jiffies + msecs_to_jiffies(r->tolerance);
1035 } else if (++r->stale_cnt > 99 && time_after(jiffies, r->stale_limit)) { 1037 } else if (++r->stale_cnt > 99 && time_after(jiffies, r->stale_limit)) {
1036 link_retransmit_failure(l, skb); 1038 link_retransmit_failure(l, skb);
1037 if (link_is_bc_sndlink(l)) 1039 if (link_is_bc_sndlink(l))
@@ -1576,9 +1578,10 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
1576 strncpy(if_name, data, TIPC_MAX_IF_NAME); 1578 strncpy(if_name, data, TIPC_MAX_IF_NAME);
1577 1579
1578 /* Update own tolerance if peer indicates a non-zero value */ 1580 /* Update own tolerance if peer indicates a non-zero value */
1579 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) 1581 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) {
1580 l->tolerance = peers_tol; 1582 l->tolerance = peers_tol;
1581 1583 l->bc_rcvlink->tolerance = peers_tol;
1584 }
1582 /* Update own priority if peer's priority is higher */ 1585 /* Update own priority if peer's priority is higher */
1583 if (in_range(peers_prio, l->priority + 1, TIPC_MAX_LINK_PRI)) 1586 if (in_range(peers_prio, l->priority + 1, TIPC_MAX_LINK_PRI))
1584 l->priority = peers_prio; 1587 l->priority = peers_prio;
@@ -1604,9 +1607,10 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
1604 l->rcv_nxt_state = msg_seqno(hdr) + 1; 1607 l->rcv_nxt_state = msg_seqno(hdr) + 1;
1605 1608
1606 /* Update own tolerance if peer indicates a non-zero value */ 1609 /* Update own tolerance if peer indicates a non-zero value */
1607 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) 1610 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) {
1608 l->tolerance = peers_tol; 1611 l->tolerance = peers_tol;
1609 1612 l->bc_rcvlink->tolerance = peers_tol;
1613 }
1610 /* Update own prio if peer indicates a different value */ 1614 /* Update own prio if peer indicates a different value */
1611 if ((peers_prio != l->priority) && 1615 if ((peers_prio != l->priority) &&
1612 in_range(peers_prio, 1, TIPC_MAX_LINK_PRI)) { 1616 in_range(peers_prio, 1, TIPC_MAX_LINK_PRI)) {
@@ -2223,6 +2227,8 @@ void tipc_link_set_tolerance(struct tipc_link *l, u32 tol,
2223 struct sk_buff_head *xmitq) 2227 struct sk_buff_head *xmitq)
2224{ 2228{
2225 l->tolerance = tol; 2229 l->tolerance = tol;
2230 if (l->bc_rcvlink)
2231 l->bc_rcvlink->tolerance = tol;
2226 if (link_is_up(l)) 2232 if (link_is_up(l))
2227 tipc_link_build_proto_msg(l, STATE_MSG, 0, 0, 0, tol, 0, xmitq); 2233 tipc_link_build_proto_msg(l, STATE_MSG, 0, 0, 0, tol, 0, xmitq);
2228} 2234}