This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: RedBoot sending incorrect TCP window size
- To: Donnat Eric <e dot donnat at ri dot silicomp dot fr>
- Subject: Re: [ECOS] RedBoot sending incorrect TCP window size
- From: Grant Edwards <grante at visi dot com>
- Date: Thu, 8 Feb 2001 14:58:39 -0600
- Cc: ecos-discuss at sources dot redhat dot com
- References: <20010208105133.A1381@visi.com> <3A82FE61.7F6F2EE8@ri.silicomp.fr>
On Thu, Feb 08, 2001 at 09:15:29PM +0100, Donnat Eric wrote:
> > All occurrences of "sizeof (eth_header_t)" in net.h, tcp.c, udp.c
> > need to be replace by a hard coded constant. I'll send a patch
> > later today...
>
> You can always avoid the hard coded constant by computing the
> "real" limit of the struct as the offset to the last field +
> the size of this last field. This should always work if the
> last field is not a struct/bitfield ! (See stddef.h)
For some things that might be a better solution. On a more
pragmatic note, the size of an Ethernet header is etched in
billions of pieces of silicon spread all over the world. It's
14. Always. Everywhere. It's not going to change.
> To finnish with the "sizeof" story, you will see with following
> sample that the reported value of sizeof is compatible with the
> data representation and obviously with pointer arithmetic. Look
> at gernerated asm.
I agree that the sizeof value is consistent with the code
generated by the compiler. It's just not consistent with the
size of an Ethernet header. :)
--
Grant Edwards
grante@visi.com