Re: RFFR

Frédéric Raynal <[email protected]>
Newsgroups gmane.comp.security.libnet
Message-ID <20040122140701.A22906@batman>
On Thu, Jan 22, 2004 at 01:18:13PM +0100, Alfredo Andres Omella wrote:
> 
> IMHO is very important to fix data structures not aligned in memory.
> 
> On Solaris8 SPARC an Linux RedHat 7.2 (2.4.7-10) "sizeof(struct
> libnet_stp_conf_hdr)" is 40 bytes and must be 35 bytes.
> 
> Fortunately libnet_stp_conf_hdr is not used within the libnet code but is
> susceptible to be used by users (hope nobody do it) :).
> 
> Do you think is really necessary (the structure, i mean)? :?
> 
> If you prefere to keep up with the structure one solution could be to use
> "__attribute__((packed))" but this would face 2 problems:
> a) Any user will be forced to use gcc (some people use the Sun compiler, not
> compatible with "attribute" extensions.)
> b) Packing structures will penalize the libnet performance.
> 

There is another problem : stp is not the only protocol facing the
same troubles.

Maybe for the builders, we can remove all use to these structures, and
rest on buffer. We just define starting position of each field
(counted in bytes).

Anyway that was included in my "optimizations" proposal.

	Fred Raynal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.