diff options
author | Lee Ryder <ryder.lee@mediatek.com> | 2017-02-21 10:40:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-21 19:13:51 +0100 |
commit | b3bdc3acbb44d74d0b7ba4d97169577a2b46dc88 (patch) | |
tree | 4afee39b62f19479172989a0ace70f7b921b4e4c /drivers/net/macsec.c | |
parent | net: sock: Use USEC_PER_SEC macro instead of literal 1000000 (diff) | |
download | linux-b3bdc3acbb44d74d0b7ba4d97169577a2b46dc88.tar.xz linux-b3bdc3acbb44d74d0b7ba4d97169577a2b46dc88.zip |
macsec: fix validation failed in asynchronous operation.
MACSec test failed when asynchronous crypto operations is used. It
encounters packet validation failed since macsec_skb_cb(skb)->valid
is always 'false'.
This patch adds missing "macsec_skb_cb(skb)->valid = true" in
macsec_decrypt_done() when "err == 0".
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macsec.c')
-rw-r--r-- | drivers/net/macsec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 778a77303c49..ff0a5ed3ca80 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -879,6 +879,9 @@ static void macsec_decrypt_done(struct crypto_async_request *base, int err) aead_request_free(macsec_skb_cb(skb)->req); + if (!err) + macsec_skb_cb(skb)->valid = true; + rcu_read_lock_bh(); pn = ntohl(macsec_ethhdr(skb)->packet_number); if (!macsec_post_decrypt(skb, &macsec->secy, pn)) { |