mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[IPSEC]: Move integrity stat collection into xfrm_input
Similar to the moving out of the replay processing on the output, this patch moves the integrity stat collectin from x->type->input into xfrm_input. This would eventually allow transforms such as AH/ESP to be lockless. The error value EBADMSG (currently unused in the crypto layer) is used to indicate a failed integrity check. In future this error can be directly returned by the crypto layer once we switch to aead algorithms. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
b2aa5e9d43
commit
668dc8af31
5 changed files with 15 additions and 12 deletions
|
|
@ -147,8 +147,11 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
|
|||
goto drop_unlock;
|
||||
|
||||
nexthdr = x->type->input(x, skb);
|
||||
if (nexthdr <= 0)
|
||||
if (nexthdr <= 0) {
|
||||
if (nexthdr == -EBADMSG)
|
||||
x->stats.integrity_failed++;
|
||||
goto drop_unlock;
|
||||
}
|
||||
|
||||
skb_network_header(skb)[nhoff] = nexthdr;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue