Return-Path: X-Original-To: rt-comment@krbdev.mit.edu Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by krbdev.mit.edu (Postfix) with ESMTP id E628CCD08F for ; Tue, 30 Dec 2008 19:47:29 +0000 (UTC) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id mBUJlF2g021064; Tue, 30 Dec 2008 14:47:27 -0500 (EST) Received: from NOME-KING.MIT.EDU (NOME-KING.MIT.EDU [18.18.1.160]) (authenticated bits=0) (User authenticated as raeburn@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id mBUJgfJI024393 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Tue, 30 Dec 2008 14:42:42 -0500 (EST) Message-ID: <8F70FCB8-B8A0-45CB-8A87-3F1C0C8C67BB@mit.edu> From: Ken Raeburn To: rt-comment@krbdev.mit.edu In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Re: [krbdev.mit.edu #6308] Alignment problem in resolver test MIME-Version: 1.0 (Apple Message framework v930.3) Date: Tue, 30 Dec 2008 14:42:41 -0500 References: X-Mailer: Apple Mail (2.930.3) X-Scanned-BY: MIMEDefang 2.42 X-Spam-Flag: NO X-Spam-Score: 0.00 RT-Send-Cc: X-RT-Original-Encoding: us-ascii Content-Length: 528 On Dec 30, 2008, at 14:32, Ezra Peisach via RT wrote: > With regards to alignment - I believe that is why the "fix" to use a > union would force an alignment. I will use an in_addr to ensure > alignment. > As I indicated in my initial analysis - there is one other place > gethostbyaddr is used w/o a struct in_addr - but the memory is > malloced. I am correct that malloc will return an alignment that is > compatible w/ any structure - right? To the best of my knowledge, yes, it'll have to be aligned well enough. Ken