Skip to content

Commit

Permalink
tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set
Browse files Browse the repository at this point in the history
When key_exchange is disabled, there is no reason to accept MSG_CRYPTO
msgs if it doesn't send MSG_CRYPTO msgs.

Signed-off-by: Xin Long <[email protected]>
Acked-by: Jon Maloy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
lxin authored and davem330 committed Dec 13, 2021
1 parent 3a6c12a commit 6180c78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/tipc/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,8 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb,
return false;
#ifdef CONFIG_TIPC_CRYPTO
case MSG_CRYPTO:
if (TIPC_SKB_CB(skb)->decrypted) {
if (sysctl_tipc_key_exchange_enabled &&
TIPC_SKB_CB(skb)->decrypted) {
tipc_crypto_msg_rcv(l->net, skb);
return true;
}
Expand Down

0 comments on commit 6180c78

Please sign in to comment.