Re: raw socket, IP_HDRINCL byteorder

Bill Fenner <[email protected]> Thu, 26 Sep 2002 08:18:22 -0700
Newsgroups gmane.os.bsd.api.general
Message-ID <[email protected]>
>	outgoing:
>	ip_len: the whole IP packet length (not the payload)

As it would appear on the wire, right?

>	ip_off: offset portion and MF bit has to be zero.

I don't like this restriction - I used raw sockets with offsets to
simulate the win95 "ping of death" - FreeBSD's ip_output couldn't
fragment a 65538 byte packet, but with hand-crafted offset and MF
I could.

>	ip_id: overwritten by the kernel

if 0?  or always?

>	ip_sum: overwritten by the kernel

hm.  This is only really required if the kernel fills in any other
fields.

How about ip_src?  Is leaving it zero to have the kernel fill it in
allowed?

>	ip option: ???? interaction with IP_OPTIONS?

Indeed.  FreeBSD permits options in a raw packet if no IP_OPTIONS
option is set, or vice versa, but not both.  That's easy enough to
implement, so maybe we should define it that way.

  Bill

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