net/mlx5e: fix return value check in mlx5e_ipsec_remove_trailer()
[ Upstream commit e5bcb7564d3bd0c88613c76963c5349be9c511c5 ]
mlx5e_ipsec_remove_trailer() should return an error code if function
pskb_trim() returns an unexpected value.
Fixes: 2ac9cfe782 ("net/mlx5e: IPSec, Add Innova IPSec offload TX data path")
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0582a3caaa
commit
a7b5f00100
1 changed files with 3 additions and 1 deletions
|
|
@ -58,7 +58,9 @@ static int mlx5e_ipsec_remove_trailer(struct sk_buff *skb, struct xfrm_state *x)
|
|||
|
||||
trailer_len = alen + plen + 2;
|
||||
|
||||
pskb_trim(skb, skb->len - trailer_len);
|
||||
ret = pskb_trim(skb, skb->len - trailer_len);
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
ipv4hdr->tot_len = htons(ntohs(ipv4hdr->tot_len) - trailer_len);
|
||||
ip_send_check(ipv4hdr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue