From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yonatan Goldschmidt Subject: [PATCH] net: ipv4: Remove MTU check in IP_HDRINCL send flow Date: Sun, 7 Jan 2018 01:26:48 +0200 Message-ID: <20180106232647.GA8203@jong.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "David S. Miller" To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:32959 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbeAFX0x (ORCPT ); Sat, 6 Jan 2018 18:26:53 -0500 Received: by mail-wm0-f67.google.com with SMTP id g130so11040588wme.0 for ; Sat, 06 Jan 2018 15:26:52 -0800 (PST) Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-ID: IP fragmentation can be performed as expected down the stack, without touching irrelevant fields in the included header besides fragment offset, setting IP_MF and header checksum. If the included header has IP_DF set, EMSGSIZE is returned. This allows users of IP_HDRINCL to have the kernel perform fragmentation. Signed-off-by: Yonatan Goldschmidt --- net/ipv4/raw.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 125c1eab3eaa..63167abff05b 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -359,11 +359,6 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi*, struct rtable *rt = *rtp; int hlen, tlen; - if (length > rt->dst.dev->mtu) { - ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport, - rt->dst.dev->mtu); - return -EMSGSIZE; - } if (length < sizeof(struct iphdr)) return -EINVAL;