Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2001 11:20:11 +0100
From:      Bernd Walter <ticso@cicely9.cicely.de>
To:        Matthew Jacob <mjacob@feral.com>
Cc:        Wilko Bulte <wkb@freebie.xs4all.nl>, freebsd-alpha@FreeBSD.ORG
Subject:   Re: FreeBSD 4.5 alpha buyglet
Message-ID:  <20011223102010.GC61241@cicely9.cicely.de>
In-Reply-To: <Pine.BSF.4.21.0112230018040.2582-100000@beppo>
References:  <20011223080046.GB61241@cicely9.cicely.de> <Pine.BSF.4.21.0112230018040.2582-100000@beppo>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 23, 2001 at 12:19:24AM -0800, Matthew Jacob wrote:
> > 
> > What else would you use for loading a 64 bit value?
> 
> 
> Not if it's not aligned, and because the structure is fully enumerated, it
> should be known to be unaligned.

Sorry - but I'm completely missing the reason why it should be unaligned.
A 64 bit value starts at a n*8 address relative from the structure
beginning unless explizit requested otherwise.

> > If it starts with the second or later interface I would asume it's because
> > several structs are concatenated in the sysctl output and read as one. If
> > one of them is not n*8 bytes long you get an alignment offset. But as I
> > don't have more debug output than posted on the list I can only guess.
> 
> The structures are all listed in if.h. 
> 
> Well- I must be wrong. I'm sure somebody would have fixed soemthing this
> egregious.

If you look at what Wilko Bulke posted you will notice that the status
function gets a 4*n aligned ifm.
The first ifm is located at offset 0 from the malloced buf so it should
be propper aligned.

Sysctl transfers 2 structures for each interface.
If the second structure is not n*8 byte in length the next ifm is wrong
aligned.
This happens in sbin/ifconfig/ifconfig.c and sys/net/rtsock.c

-- 
B.Walter              COSMO-Project         http://www.cosmo-project.de
ticso@cicely.de         Usergroup           info@cosmo-project.de


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




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