diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2016-04-07 16:09:14 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-07 23:00:13 +0200 |
commit | 5b7066c3dd24c7d538e5ee402eb24bb182c16dab (patch) | |
tree | 4c48098cd2b13be2819e1e6a4918b4dced748ab1 /net/tipc/msg.h | |
parent | tipc: eliminate buffer leak in bearer layer (diff) | |
download | linux-5b7066c3dd24c7d538e5ee402eb24bb182c16dab.tar.xz linux-5b7066c3dd24c7d538e5ee402eb24bb182c16dab.zip |
tipc: stricter filtering of packets in bearer layer
Resetting a bearer/interface, with the consequence of resetting all its
pertaining links, is not an atomic action. This becomes particularly
evident in very large clusters, where a lot of traffic may happen on the
remaining links while we are busy shutting them down. In extreme cases,
we may even see links being re-created and re-established before we are
finished with the job.
To solve this, we now introduce a solution where we temporarily detach
the bearer from the interface when the bearer is reset. This inhibits
all packet reception, while sending still is possible. For the latter,
we use the fact that the device's user pointer now is zero to filter out
which packets can be sent during this situation; i.e., outgoing RESET
messages only. This filtering serves to speed up the neighbors'
detection of the loss event, and saves us from unnecessary probing.
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/msg.h')
-rw-r--r-- | net/tipc/msg.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index 55778a0aebf3..f34f639df643 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h @@ -779,6 +779,11 @@ static inline bool msg_peer_node_is_up(struct tipc_msg *m) return msg_redundant_link(m); } +static inline bool msg_is_reset(struct tipc_msg *hdr) +{ + return (msg_user(hdr) == LINK_PROTOCOL) && (msg_type(hdr) == RESET_MSG); +} + struct sk_buff *tipc_buf_acquire(u32 size); bool tipc_msg_validate(struct sk_buff *skb); bool tipc_msg_reverse(u32 own_addr, struct sk_buff **skb, int err); |