netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Fragment large datagrams even when IP_HDRINCL is set.
@ 2016-05-23 14:23 Alan Davey
  2016-05-31 18:39 ` David Miller
  0 siblings, 1 reply; 14+ messages in thread
From: Alan Davey @ 2016-05-23 14:23 UTC (permalink / raw)
  To: davem; +Cc: netdev, kuznet, jmorris, yoshfuji, kaber, Alan Davey

One of the bugs documented in the raw(7) man page is as follows: When the
IP_HDRINCL option is set, datagrams will not be fragmented and are limited to
the interface MTU.

This patch fixes the bug by removing the check for "length > rt->dst.dev->mtu"
in raw_send_hdrinc() (net/ipv4/raw.c).  Datagrams are no longer limited to the
interface MTU size if the IP_HDRINCL option is set, but are fragmented, if
necessary, in the same way as all other datagrams.

Signed-off-by: Alan Davey <alan.davey@metaswitch.com>
---
 net/ipv4/raw.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 8d22de7..de690b3 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -351,11 +351,6 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
 	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 (flags&MSG_PROBE)
 		goto out;
 
-- 
1.8.3.1

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

end of thread, other threads:[~2021-12-14 12:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 14:23 [PATCH] net: Fragment large datagrams even when IP_HDRINCL is set Alan Davey
2016-05-31 18:39 ` David Miller
2016-06-08  8:41   ` Alan Davey
2016-06-08  9:33     ` YOSHIFUJI Hideaki
2016-06-08  9:39     ` Paul Jakma
2016-06-08 17:25     ` David Miller
2016-06-15 10:41       ` Alan Davey
2016-07-08 12:55         ` Paul Jakma
2016-07-08 22:41           ` David Miller
2016-07-08 23:21             ` Alexey Kuznetsov
2016-07-12 12:34             ` Alan Davey
2016-07-12 18:11               ` David Miller
2021-12-14 12:03                 ` Senthil Kumar Nagappan
2016-06-15 13:03   ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).