From 69fae5353a6b71264afb3069d549e1bbdd88d643 Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Wed, 22 Mar 2023 15:09:38 -0700 Subject: [PATCH] gro: remove unnecessary restriction on GRO-able packets DF doesn't need to be set. Linux also allows GRO on packets without DF set. This fixes an issue where loopback traffic couldn't be GRO'd because gVisor never sets the DF bit (we don't implement PMTUD yet). PiperOrigin-RevId: 518684608 --- pkg/tcpip/stack/gro.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/tcpip/stack/gro.go b/pkg/tcpip/stack/gro.go index 29a1b7061..acbb8f297 100644 --- a/pkg/tcpip/stack/gro.go +++ b/pkg/tcpip/stack/gro.go @@ -451,9 +451,9 @@ func (gd *groDispatcher) dispatch4(pkt PacketBufferPtr, ep NetworkEndpoint) { } ipHdr := header.IPv4(hdrBytes) - // We only handle atomic packets. That's the vast majority of traffic, - // and simplifies handling. - if ipHdr.FragmentOffset() != 0 || ipHdr.Flags()&header.IPv4FlagMoreFragments != 0 || ipHdr.Flags()&header.IPv4FlagDontFragment == 0 { + // We don't handle fragments. That should be the vast majority of + // traffic, and simplifies handling. + if ipHdr.FragmentOffset() != 0 || ipHdr.Flags()&header.IPv4FlagMoreFragments != 0 { ep.HandlePacket(pkt) return }