netdev
[Top] [All Lists]

Re: raw sockets, IP_HDRINCL, and fragmentation

To: Chris Friesen <cfriesen@xxxxxxxxxxxxxxxxxx>
Subject: Re: raw sockets, IP_HDRINCL, and fragmentation
From: Andi Kleen <ak@xxxxxxx>
Date: Fri, 8 Mar 2002 09:17:06 +0100
Cc: Andi Kleen <ak@xxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <3C87D3F3.315C76D5@xxxxxxxxxxxxxxxxxx>
References: <3C87AD05.F9BC8457@xxxxxxxxxxxxxxxxxx> <20020307191645.A27213@xxxxxxxxxxxxxxxx> <3C87B887.3757786F@xxxxxxxxxxxxxxxxxx> <20020307201818.A8893@xxxxxxxxxxxxx> <3C87D3F3.315C76D5@xxxxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.3.22.1i
On Thu, Mar 07, 2002 at 03:56:19PM -0500, Chris Friesen wrote:
> Andi Kleen wrote:
> > 
> > On Thu, Mar 07, 2002 at 01:59:19PM -0500, Chris Friesen wrote:
> 
> > > "When  the IP_HDRINCL option is set datagrams will not be fragmented and 
> > > are
> > > limited to the interface MTU.  This is a limitation in Linux 2.2."
> > >
> > > Does 2.4 have this same limitation?
> > 
> > It has.
> 
> Is this a technical difficulty, or just an API issue?  ie, how hard would it 
> be
> to hack it to add fragmentation?  I'm guessing I should be looking at
> ip_output.c, somewhere in the vicinity of ip_build_xmit()?

It is not clear if it makes sense at all. Fragmenting would require changing the
IP header you supplied. Do you expect that? It is probably better to never 
change
the IP header with IP_HDRINCL.

In fact on Linux you should not really ever need to use IP_HDRINCL. Nearly 
everything
that can be usefully changed on an IP header (ttl,tos,options,addresses etc.) 
can be 
changed with other socket options too and these are compatible with fragmenting.

-Andi

<Prev in Thread] Current Thread [Next in Thread>