Re: <netinet/ip.h> & <netinet/tcp.h> bug?
Re: <netinet/ip.h> & <netinet/tcp.h> bug?
- Subject: Re: <netinet/ip.h> & <netinet/tcp.h> bug?
- From: Peter Lovell <email@hidden>
- Date: Thu, 13 Jun 2002 16:34:57 -0400
>
I am moving some code over to CodeWarrior from Project Builder and I think I
>
have discovered a bug in <netinet/ip.h> and <netinet/tcp.h>. The bitfields of
>
struct ip and struct tcphdr are declared as u_ints ( 4 bytes ) but shouldn't
>
they be u_chars ( 1 byte )?
>
>
Thanks,
>
Matthew.
>
--
>
<http://www.interarchy.com/> <ftp://ftp.interarchy.com/interarchy.hqx>
Hi Matthew,
underlying problem stems from early C restriction that bitfields can only
be packed into an "int" kind of field. Packing into a "char" was not
permitted.
This restriction has been removed or softened by many compilers but I
guess we're seeing the early heritage of these headers in this case, as
they needed to work on many compilers on many different systems.
Regards.....Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.