aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index ec4d28328652..065e9e67da5d 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -130,6 +130,8 @@ struct tipc_link {
130 /* Management and link supervision data */ 130 /* Management and link supervision data */
131 u32 peer_session; 131 u32 peer_session;
132 u32 session; 132 u32 session;
133 u16 snd_nxt_state;
134 u16 rcv_nxt_state;
133 u32 peer_bearer_id; 135 u32 peer_bearer_id;
134 u32 bearer_id; 136 u32 bearer_id;
135 u32 tolerance; 137 u32 tolerance;
@@ -339,6 +341,11 @@ char tipc_link_plane(struct tipc_link *l)
339 return l->net_plane; 341 return l->net_plane;
340} 342}
341 343
344void tipc_link_update_caps(struct tipc_link *l, u16 capabilities)
345{
346 l->peer_caps = capabilities;
347}
348
342void tipc_link_add_bc_peer(struct tipc_link *snd_l, 349void tipc_link_add_bc_peer(struct tipc_link *snd_l,
343 struct tipc_link *uc_l, 350 struct tipc_link *uc_l,
344 struct sk_buff_head *xmitq) 351 struct sk_buff_head *xmitq)
@@ -859,6 +866,8 @@ void tipc_link_reset(struct tipc_link *l)
859 l->rcv_unacked = 0; 866 l->rcv_unacked = 0;
860 l->snd_nxt = 1; 867 l->snd_nxt = 1;
861 l->rcv_nxt = 1; 868 l->rcv_nxt = 1;
869 l->snd_nxt_state = 1;
870 l->rcv_nxt_state = 1;
862 l->acked = 0; 871 l->acked = 0;
863 l->silent_intv_cnt = 0; 872 l->silent_intv_cnt = 0;
864 l->rst_cnt = 0; 873 l->rst_cnt = 0;
@@ -1353,6 +1362,8 @@ static void tipc_link_build_proto_msg(struct tipc_link *l, int mtyp, bool probe,
1353 msg_set_seqno(hdr, l->snd_nxt + U16_MAX / 2); 1362 msg_set_seqno(hdr, l->snd_nxt + U16_MAX / 2);
1354 1363
1355 if (mtyp == STATE_MSG) { 1364 if (mtyp == STATE_MSG) {
1365 if (l->peer_caps & TIPC_LINK_PROTO_SEQNO)
1366 msg_set_seqno(hdr, l->snd_nxt_state++);
1356 msg_set_seq_gap(hdr, rcvgap); 1367 msg_set_seq_gap(hdr, rcvgap);
1357 msg_set_bc_gap(hdr, link_bc_rcv_gap(bcl)); 1368 msg_set_bc_gap(hdr, link_bc_rcv_gap(bcl));
1358 msg_set_probe(hdr, probe); 1369 msg_set_probe(hdr, probe);
@@ -1522,6 +1533,11 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb,
1522 1533
1523 case STATE_MSG: 1534 case STATE_MSG:
1524 1535
1536 if (l->peer_caps & TIPC_LINK_PROTO_SEQNO &&
1537 less(msg_seqno(hdr), l->rcv_nxt_state))
1538 break;
1539 l->rcv_nxt_state = msg_seqno(hdr) + 1;
1540
1525 /* Update own tolerance if peer indicates a non-zero value */ 1541 /* Update own tolerance if peer indicates a non-zero value */
1526 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL)) 1542 if (in_range(peers_tol, TIPC_MIN_LINK_TOL, TIPC_MAX_LINK_TOL))
1527 l->tolerance = peers_tol; 1543 l->tolerance = peers_tol;