Re: raw socket, IP_HDRINCL byteorder
Dug Song <[email protected]> Thu, 26 Sep 2002 12:19:38 -0400
| Newsgroups | gmane.os.bsd.api.general |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Sep 26, 2002 at 06:19:39PM +0900, [email protected] wrote: > how about this. all fields are in network byteorder. > > outgoing: > ip_len: the whole IP packet length (not the payload) > ip_off: offset portion and MF bit has to be zero. > ip_id: overwritten by the kernel > ip_sum: overwritten by the kernel > ip option: ???? interaction with IP_OPTIONS? IMO, the outgoing packet shouldn't be touched at all - just written as-is to the wire. the proposed restriction on ip_off is problematic for applications which need to create IP fragments, and there are several awful workarounds people have had to resort to to acheive this, for example, on Solaris. > incoming: > ip_len: the whole IP packet length (not the payload) = as is > ip_off: as is (same as the packet on the wire) > ip_id: as is (same as the packet on the wire) > ip_sum: as is (same as the packet on the wire) > ip option: as is (same as the packet on the wire) looks great! :-) -d. --- http://www.monkey.org/~dugsong/ --------------------------------------------------------------------- The BSD APIs Discussion Mailing List To unsubscribe: send "unsubscribe bsd-api-discuss" to majordomo-DZEk9q7Sfju/3pe1ocb+swC/[email protected]