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.da...@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

Reply via email to