summaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-07-09 19:07:36 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-12 02:06:14 -0400
commit7ea817f4e8322fa27fb860d15025bf72f68b179f (patch)
tree906e6081a486ba6f244a8c0bb6d7c51c6343423d /net/tipc/node.c
parent9012de5089560136b849b920ad038b96160ed8f6 (diff)
tipc: check session number before accepting link protocol messages
In some virtual environments we observe a significant higher number of packet reordering and delays than we have been used to traditionally. This makes it necessary with stricter checks on incoming link protocol messages' session number, which until now only has been validated for RESET messages. Since the other two message types, ACTIVATE and STATE messages also carry this number, it is easy to extend the validation check to those messages. We also introduce a flag indicating if a link has a valid peer session number or not. This eliminates the mixing of 32- and 16-bit arithmethics we are currently using to achieve this. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 1cdb176798f7..52fd80b0e728 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1540,7 +1540,7 @@ static void tipc_node_bc_rcv(struct net *net, struct sk_buff *skb, int bearer_id
1540 * tipc_node_check_state - check and if necessary update node state 1540 * tipc_node_check_state - check and if necessary update node state
1541 * @skb: TIPC packet 1541 * @skb: TIPC packet
1542 * @bearer_id: identity of bearer delivering the packet 1542 * @bearer_id: identity of bearer delivering the packet
1543 * Returns true if state is ok, otherwise consumes buffer and returns false 1543 * Returns true if state and msg are ok, otherwise false
1544 */ 1544 */
1545static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb, 1545static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb,
1546 int bearer_id, struct sk_buff_head *xmitq) 1546 int bearer_id, struct sk_buff_head *xmitq)
@@ -1574,6 +1574,9 @@ static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb,
1574 } 1574 }
1575 } 1575 }
1576 1576
1577 if (!tipc_link_validate_msg(l, hdr))
1578 return false;
1579
1577 /* Check and update node accesibility if applicable */ 1580 /* Check and update node accesibility if applicable */
1578 if (state == SELF_UP_PEER_COMING) { 1581 if (state == SELF_UP_PEER_COMING) {
1579 if (!tipc_link_is_up(l)) 1582 if (!tipc_link_is_up(l))