summaryrefslogtreecommitdiff
path: root/net/tipc/crypto.h
diff options
context:
space:
mode:
authorTuong Lien <tuong.t.lien@dektech.com.au>2020-09-18 08:17:26 +0700
committerDavid S. Miller <davem@davemloft.net>2020-09-18 13:58:37 -0700
commitf779bf792284fed78fedee61b46df2d4652636d3 (patch)
tree30feab7a1680d6e73d0ac9d93dff413ceb0bb1f8 /net/tipc/crypto.h
parentcb589a55f45af3c96c4c828eeb78b52584d483e0 (diff)
tipc: optimize key switching time and logic
We reduce the lasting time for a pending TX key to be active as well as for a passive RX key to be freed which generally helps speed up the key switching. It is not expected to be too fast but should not be too slow either. Also the key handling logic is simplified that a pending RX key will be removed automatically if it is found not working after a number of times; the probing for a pending TX key is now carried on a specific message user ('LINK_PROTOCOL' or 'LINK_CONFIG') which is more efficient than using a timer on broadcast messages, the timer is reserved for use later as needed. The kernel logs or 'pr***()' are now made as clear as possible to user. Some prints are added, removed or changed to the debug-level. The 'TIPC_CRYPTO_DEBUG' definition is removed, and the 'pr_debug()' is used instead which will be much helpful in runtime. Besides we also optimize the code in some other places as a preparation for later commits. v2: silent more kernel logs, also use 'info->extack' for a message emitted due to netlink operations instead (- David's comments). Acked-by: Jon Maloy <jmaloy@redhat.com> Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/crypto.h')
-rw-r--r--net/tipc/crypto.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/crypto.h b/net/tipc/crypto.h
index c3de769f49e8..c387240e03d0 100644
--- a/net/tipc/crypto.h
+++ b/net/tipc/crypto.h
@@ -160,7 +160,7 @@ int tipc_crypto_rcv(struct net *net, struct tipc_crypto *rx,
int tipc_crypto_key_init(struct tipc_crypto *c, struct tipc_aead_key *ukey,
u8 mode);
void tipc_crypto_key_flush(struct tipc_crypto *c);
-int tipc_aead_key_validate(struct tipc_aead_key *ukey);
+int tipc_aead_key_validate(struct tipc_aead_key *ukey, struct genl_info *info);
bool tipc_ehdr_validate(struct sk_buff *skb);
#endif /* _TIPC_CRYPTO_H */