From: Yonatan Goldschmidt <dev.jongy@gmail.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Subject: [PATCH] net: ipv4: Remove MTU check in IP_HDRINCL send flow
Date: Sun, 7 Jan 2018 01:26:48 +0200 [thread overview]
Message-ID: <20180106232647.GA8203@jong.localdomain> (raw)
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 <dev.jongy@gmail.com>
---
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;
next reply other threads:[~2018-01-06 23:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-06 23:26 Yonatan Goldschmidt [this message]
2018-01-07 1:41 ` [PATCH] net: ipv4: Remove MTU check in IP_HDRINCL send flow David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180106232647.GA8203@jong.localdomain \
--to=dev.jongy@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox