developer | 4f0d2ba | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 1 | --- a/net/xfrm/xfrm_output.c |
| 2 | +++ b/net/xfrm/xfrm_output.c |
| 3 | @@ -410,7 +410,7 @@ static int xfrm_output_one(struct sk_buf |
| 4 | struct xfrm_state *x = dst->xfrm; |
| 5 | struct net *net = xs_net(x); |
| 6 | |
| 7 | - if (err <= 0 || x->xso.type == XFRM_DEV_OFFLOAD_PACKET) |
| 8 | + if (err <= 0) |
| 9 | goto resume; |
| 10 | |
| 11 | do { |
developer | 2d41861 | 2023-10-19 16:40:53 +0800 | [diff] [blame] | 12 | @@ -570,12 +570,10 @@ int xfrm_output(struct sock *sk, struct |
developer | 4f0d2ba | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 13 | |
developer | 2d41861 | 2023-10-19 16:40:53 +0800 | [diff] [blame] | 14 | if (x->xso.type == XFRM_DEV_OFFLOAD_PACKET) { |
| 15 | if (!xfrm_dev_offload_ok(skb, x)) { |
developer | 4f0d2ba | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 16 | - XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTERROR); |
| 17 | - kfree_skb(skb); |
| 18 | - return -EHOSTUNREACH; |
developer | 2d41861 | 2023-10-19 16:40:53 +0800 | [diff] [blame] | 19 | + secpath_reset(skb); |
| 20 | + goto sw_path; |
| 21 | } |
developer | 4f0d2ba | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 22 | - |
| 23 | - return xfrm_output_resume(skb, 0); |
developer | 2d41861 | 2023-10-19 16:40:53 +0800 | [diff] [blame] | 24 | + return 0; |
| 25 | } |
developer | 4f0d2ba | 2023-08-21 17:33:25 +0800 | [diff] [blame] | 26 | |
developer | 2d41861 | 2023-10-19 16:40:53 +0800 | [diff] [blame] | 27 | secpath_reset(skb); |
| 28 | @@ -606,6 +604,7 @@ int xfrm_output(struct sock *sk, struct |
| 29 | if (x->xso.dev && x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM) |
| 30 | goto out; |
| 31 | } else { |
| 32 | +sw_path: |
| 33 | if (skb_is_gso(skb)) |
| 34 | return xfrm_output_gso(net, sk, skb); |
| 35 | } |