Re: raw socket, IP_HDRINCL byteorder
[email protected] Mon, 23 Sep 2002 23:48:39 +0900
| 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) i forgot to mention one thing - IP_HDRINCL is used for two reasons: - prototyping L4 code (like new transport layer protocol) in this case, we will want byteorder/content to be the same as the ones used in IPv4 kernel code. - allow applications to send/receive the whole IPv4 packet as is in this case, we will want fields handled equally as wire format, i.e. network byteorder and ip_len is for the whole packet. the 4.[34]BSD kernel code/behavior is biased to the former bullet, i guess. the reality is that we see much more apps use the API for the latter bullet than the former. itojun --------------------------------------------------------------------- The BSD APIs Discussion Mailing List To unsubscribe: send "unsubscribe bsd-api-discuss" to majordomo-DZEk9q7Sfju/3pe1ocb+swC/[email protected]