From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next] inet: defrag: drop non-last frags smaller than min mtu Date: Thu, 2 Aug 2018 16:54:22 -0700 Message-ID: <4b249fb2-d826-dbea-cd97-55cb336e230f@gmail.com> References: <20180802234348.16559-1-fw@strlen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Peter Oskolkov , Eric Dumazet To: Florian Westphal , netdev@vger.kernel.org Return-path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:33955 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbeHCBrx (ORCPT ); Thu, 2 Aug 2018 21:47:53 -0400 Received: by mail-pg1-f193.google.com with SMTP id y5-v6so1961754pgv.1 for ; Thu, 02 Aug 2018 16:54:24 -0700 (PDT) In-Reply-To: <20180802234348.16559-1-fw@strlen.de> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 08/02/2018 04:43 PM, Florian Westphal wrote: > don't bother with pathological cases, they only waste cycles. > IPv6 requires a minimum MTU of 1280 so we should never see fragments > smaller than this (except last frag). > > For IPv4, in practice, we could probably also adopt a higher limit, > but for now use ipv4 min mtu (68). ... > + if (-skb_network_offset(skb) + skb->len < IPV4_MIN_MTU && > + ip_hdr(skb)->frag_off & htons(IP_MF)) > + goto drop; > + > I am not totally sure this is legit for IPv4. Some intermediate nodes can try to be smart and could decide to further split fragments. I am pretty sure I have seen this behavior on some radio environments :/ Eventually we could add a sysctl to allow an admin to set the threshold ?