Re: [Hipsec] draft-ietf-hip-native-api-09-pre

Andrew McGregor <andrew@indranet.co.nz> Mon, 24 August 2009 22:27 UTC

Return-Path: <andrew@indranet.co.nz>
X-Original-To: hipsec@core3.amsl.com
Delivered-To: hipsec@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id D918C3A69D1 for <hipsec@core3.amsl.com>; Mon, 24 Aug 2009 15:27:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.054
X-Spam-Level:
X-Spam-Status: No, score=-0.054 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FH_RELAY_NODNS=1.451, RDNS_NONE=0.1, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xkveKTuAB54N for <hipsec@core3.amsl.com>; Mon, 24 Aug 2009 15:27:30 -0700 (PDT)
Received: from mail.indranet.co.nz (unknown [203.97.93.68]) by core3.amsl.com (Postfix) with ESMTP id DCBAB3A6AFE for <hipsec@ietf.org>; Mon, 24 Aug 2009 15:27:29 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.indranet.co.nz (Postfix) with ESMTP id 7EECFA42D5A; Tue, 25 Aug 2009 10:27:28 +1200 (NZST)
X-Virus-Scanned: amavisd-new at indranet.co.nz
Received: from mail.indranet.co.nz ([127.0.0.1]) by localhost (XServe-2.acheron.indranet.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EJ7XhH2npPEx; Tue, 25 Aug 2009 10:27:28 +1200 (NZST)
Received: from Andrew-X.ferryrd.indranet.co.nz (Andrew-X.ferryrd.indranet.co.nz [192.168.1.11]) by mail.indranet.co.nz (Postfix) with ESMTP id 29939A42D4E; Tue, 25 Aug 2009 10:27:28 +1200 (NZST)
Message-Id: <DED135E8-7FAD-49EE-B712-BFF2EDC53735@indranet.co.nz>
From: Andrew McGregor <andrew@indranet.co.nz>
To: "Ahrenholz, Jeffrey M" <jeffrey.m.ahrenholz@boeing.com>
In-Reply-To: <0DF156EE7414494187B087A3C279BDB404AD7C7C@XCH-NW-6V1.nw.nos.boeing.com>
Content-Type: text/plain; charset="US-ASCII"; format="flowed"; delsp="yes"
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Date: Tue, 25 Aug 2009 10:27:14 +1200
References: <4A8DBB16.3010705@hiit.fi> <0DF156EE7414494187B087A3C279BDB404AD7C73@XCH-NW-6V1.nw.nos.boeing.com> <4A8E25C6.1090100@hiit.fi> <0DF156EE7414494187B087A3C279BDB404AD7C75@XCH-NW-6V1.nw.nos.boeing.com> <4A930581.8080100@hiit.fi> <EAD6D1A8-EB90-4921-9428-1094BA00DAC0@indranet.co.nz> <0DF156EE7414494187B087A3C279BDB404AD7C7C@XCH-NW-6V1.nw.nos.boeing.com>
X-Mailer: Apple Mail (2.936)
Cc: hip WG <hipsec@ietf.org>
Subject: Re: [Hipsec] draft-ietf-hip-native-api-09-pre
X-BeenThere: hipsec@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "This is the official IETF Mailing List for the HIP Working Group." <hipsec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hipsec>, <mailto:hipsec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hipsec>
List-Post: <mailto:hipsec@ietf.org>
List-Help: <mailto:hipsec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hipsec>, <mailto:hipsec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 24 Aug 2009 22:27:30 -0000

On 25/08/2009, at 10:24 AM, Ahrenholz, Jeffrey M wrote:

>>> Based on this discussion, it appears that the best way for future
>>> proofing is to include a flag for getaddrinfo() in the hints
>>> arguments that will result in sockaddr_hip_long structures instead
>>> of sockaddr_hip. This way, applications get exactly what they want
>>> and can store the HITs easily in their ACLs. I'd also remove the
>>> extra space reserved space because it seems that it's not very
>>> usable for future proofing as it is now.
>>>
>>> Jeff, how do you feel about this or do you have a better suggestion?
>>
>> I think you'd be better to define more than a flag... an
>> explicit size
>> (or enum) would be better.  That way if some other odd size
>> becomes a
>> requirement later, it's not such an annoyance to fit in to the API
>
> yes, a size or flag makes sense; looks like struct addrinfo already  
> has
> "size_t ai_addrlen;" but that field must be zero when used as hints
> (looking at getaddrinfo(3) man)
>
> other calls such as connect(), bind(), and sendto() already take a
> "socklen_t addrlen" argument
>
> -Jeff
>

Ah, in that case... getaddrinfo should return whatever it can, and  
applications should be required to check lengths if they care.  That  
avoids coding in bugs early.

Andrew