Re: raw socket, IP_HDRINCL byteorder

Bill Fenner <[email protected]> Mon, 23 Sep 2002 17:50:35 -0700
Newsgroups gmane.os.bsd.api.general
Message-ID <[email protected]>
>	raw socket with IP_HDRINCL uses different network byteorder for some
>	of the IP header fields (ip_off and ip_len).  i think the behavior
>	is confusing, and the culprit is 4.[34]BSD. (4.[34]BSD should have
>	cleaned it up before supplying this API to users)

It was actually well-defined when it was introduced; it just wasn't what
people expected from it.  It's now confusing because Linux and others
decided to "fix" it.

I'd like to see a well-defined, portable raw socket interface (don't forget
raw input, where the IP header is always included so you can't tell the
desired behavior from IP_OHDRINCL / IP_HDRINCL).  I think that the right
thing to do is introduce a new socket option that sets raw sockets to behave
in the new way, and not try to overload IP_HDRINCL, whose behavior is
too OS-specific.  IP_RAW_PKTS_HAVE_NETWORK_BYTE_ORDER, except that's too
long =)

  Bill

---------------------------------------------------------------------
The BSD APIs Discussion Mailing List
To unsubscribe:
send "unsubscribe bsd-api-discuss" to majordomo-DZEk9q7Sfju/3pe1ocb+swC/[email protected]