All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ipsec] xfrm: remove the fragment check for ipv6 beet mode
@ 2021-05-29 20:23 Xin Long
  2021-06-03  8:18 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Xin Long @ 2021-05-29 20:23 UTC (permalink / raw)
  To: netdev; +Cc: kuba, Sabrina Dubroca, Steffen Klassert, David S . Miller

In commit 68dc022d04eb ("xfrm: BEET mode doesn't support fragments
for inner packets"), it tried to fix the issue that in TX side the
packet is fragmented before the ESP encapping while in the RX side
the fragments always get reassembled before decapping with ESP.

This is not true for IPv6. IPv6 is different, and it's using exthdr
to save fragment info, as well as the ESP info. Exthdrs are added
in TX and processed in RX both in order. So in the above case, the
ESP decapping will be done earlier than the fragment reassembling
in TX side.

Here just remove the fragment check for the IPv6 inner packets to
recover the fragments support for BEET mode.

Fixes: 68dc022d04eb ("xfrm: BEET mode doesn't support fragments for inner packets")
Reported-by: Xiumei Mu <xmu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/xfrm/xfrm_output.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index e4cb0ff4dcf4..ac907b9d32d1 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -711,15 +711,8 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
 static int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb)
 {
 #if IS_ENABLED(CONFIG_IPV6)
-	unsigned int ptr = 0;
 	int err;
 
-	if (x->outer_mode.encap == XFRM_MODE_BEET &&
-	    ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL, NULL) >= 0) {
-		net_warn_ratelimited("BEET mode doesn't support inner IPv6 fragments\n");
-		return -EAFNOSUPPORT;
-	}
-
 	err = xfrm6_tunnel_check_size(skb);
 	if (err)
 		return err;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH ipsec] xfrm: remove the fragment check for ipv6 beet mode
  2021-05-29 20:23 [PATCH ipsec] xfrm: remove the fragment check for ipv6 beet mode Xin Long
@ 2021-06-03  8:18 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2021-06-03  8:18 UTC (permalink / raw)
  To: Xin Long; +Cc: netdev, kuba, Sabrina Dubroca, David S . Miller

On Sat, May 29, 2021 at 04:23:18PM -0400, Xin Long wrote:
> In commit 68dc022d04eb ("xfrm: BEET mode doesn't support fragments
> for inner packets"), it tried to fix the issue that in TX side the
> packet is fragmented before the ESP encapping while in the RX side
> the fragments always get reassembled before decapping with ESP.
> 
> This is not true for IPv6. IPv6 is different, and it's using exthdr
> to save fragment info, as well as the ESP info. Exthdrs are added
> in TX and processed in RX both in order. So in the above case, the
> ESP decapping will be done earlier than the fragment reassembling
> in TX side.
> 
> Here just remove the fragment check for the IPv6 inner packets to
> recover the fragments support for BEET mode.
> 
> Fixes: 68dc022d04eb ("xfrm: BEET mode doesn't support fragments for inner packets")
> Reported-by: Xiumei Mu <xmu@redhat.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied, thanks Xin!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-03  8:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-29 20:23 [PATCH ipsec] xfrm: remove the fragment check for ipv6 beet mode Xin Long
2021-06-03  8:18 ` Steffen Klassert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.