Subject: Re: IP_HDRINCL
To: Jun-ichiro itojun Hagino <itojun@iijlab.net>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 08/12/2002 14:09:26
On Tue, Aug 13, 2002 at 03:54:45AM +0900, Jun-ichiro itojun Hagino wrote:

 > 	IP_HDRINCL for raw ip socket receives host endian value for ip_len
 > 	and ip_off from userland.

IIRC, the reason for this is because e.g. TCP and UDP hand ip_len to
ip_output() in host-order.  IP_HDRINCL was historically used for prototyping
stuff in userland, providing basically the same interface as the protocol
would see in the kernel.

 > 	i'm wondering what should i do about it.  my preference is in the
 > 	first option, due to the wide use of IP_HDRINCL in random thirdparty
 > 	apps (any ping/traceroute/whatever tools use IP_HDRINCL).

Yes, for ABI/API compatibility, we need to preserve the old behavior.

 > 	- define IP_HDRINCL2 (or whatever) which uses network byteorder for
 > 	  these fields.  keep IP_HDRINCL behavior the same.

I think I prefer this one.  Perhaps we could coordinate with FreeBSD on a
new IP_HDRINCL* name?  (IP_HDRINCL_RAW?  For "IP header in raw, on-wire
format"?  Eh, I'm not good at picking names :-)

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>