From owner-freebsd-net@FreeBSD.ORG Sun Dec 28 23:55:07 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78898106564A; Sun, 28 Dec 2008 23:55:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [62.111.66.27]) by mx1.freebsd.org (Postfix) with ESMTP id 33D888FC19; Sun, 28 Dec 2008 23:55:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from localhost (amavis.str.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 71FB641C733; Mon, 29 Dec 2008 00:55:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([62.111.66.27]) by localhost (amavis.str.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id eTUdRZKzve0O; Mon, 29 Dec 2008 00:55:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 17C3841C730; Mon, 29 Dec 2008 00:55:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id CDBB34448D5; Sun, 28 Dec 2008 23:53:43 +0000 (UTC) Date: Sun, 28 Dec 2008 23:53:43 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Kip Macy In-Reply-To: <3c1674c90812281530l52b83404k9822cf6818329f01@mail.gmail.com> Message-ID: <20081228234501.F28465@maildrop.int.zabbadoz.net> References: <20081228225956.G28465@maildrop.int.zabbadoz.net> <3c1674c90812281530l52b83404k9822cf6818329f01@mail.gmail.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Qing Li , freebsd-net@freebsd.org Subject: Re: arp-v2 (void *)-1 "hack" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Dec 2008 23:55:07 -0000 On Sun, 28 Dec 2008, Kip Macy wrote: Hi, >> What do you think wrt to adding the (possibly optional) int *error and >> returning the errno rather than a (void *)-1? If you'd be ok, I'd can >> prepare the patch. I'd rather break the API now than in a few months. > > I would greatly prefer having a dedicated new function that calls in > to it. There are a lot of calls to lla_lookup that would have to be > changed needlessly. In other words: Right, there are 14 or so of them and at least 2 will need to be touched. > 1) lla_lookup_internal - a static function which takes all 3 args > 2) lla_delete - which returns an errno > 3) lla_lookup - which maintains the current interface I wonder if it's worth adding two more functions for about a dozen calls from basically 2 files; especially considering that we will need to modify the internal API (llt_lookup function pointer in struct lltable and in_lltable_lookup()/in6_lltable_lookup()) anyway. That's why I thought adding the int *error now consistently would be easier and cleaner. Most of the callers, currently not caring could just pass in NULL, if they don't care and we keep the argument optional. /bz -- Bjoern A. Zeeb The greatest risk is not taking one.