diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/link.c | 16 |
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 | } |