Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Jun 2008 17:09:09 +0100
From:      "Bruce M. Simpson" <bms@FreeBSD.org>
To:        =?ISO-8859-1?Q?Marc_L=F6rner?= <marc.loerner@hob.de>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Probable Bug in tcp.h
Message-ID:  <48480FA5.3020800@FreeBSD.org>
In-Reply-To: <200806051712.47048.marc.loerner@hob.de>
References:  <200806051712.47048.marc.loerner@hob.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Marc L=F6rner wrote:
> ..
> First of all I have the problam of misalignment of th_off. Because in t=
his way=20
> always 4 bytes are read and the the bits of th_off are replaced. Then t=
he 4=20
> bytes are written back.=20
>
> But should (th_x and th_off) not only be 1 byte in whole -> only read a=
nd=20
> write 1 byte?
>  =20

Which machine architecture are you attempting to compile this code on?

On FreeBSD Tier 1 platforms, the access is probably going to come out of =

L2 cache anyway, so the fields in question will be read by a burst cycle.=


It is worth noting that NetBSD changed the base type of tcphdr's=20
bitfields to uint8_t, however this shuffles the compiler dependency into =

the treatment of the "char" type. Most modern C compilers support=20
"unsigned char".




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48480FA5.3020800>