Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Dec 2008 23:24:46 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Qing Li <qingli@freebsd.org>
Cc:        freebsd-net@freebsd.org, Kip Macy <kmacy@freebsd.org>
Subject:   arp-v2 (void *)-1 "hack"
Message-ID:  <20081228225956.G28465@maildrop.int.zabbadoz.net>

next in thread | raw e-mail | index | archive | help
Hi,

Cc:ing freebsd-net as I came across the (void *)-1 "hack" 1.5 weeks
ago while debugging some problems with others and they might be
interested as well.

I was sure I hadn't seen that hack in patches posted before.

I spent some time today and looked a bit more into it (also comitted
the LLE_IS_VALID() check).

In short: I don't like it and I don't understand why a new API needs a
hack already that is passed down through two functions into the code.
It was introduced the last days before the commit. I found r186010 and
r186027 in SVN but that's just two of the 4 places.

I think the proper behavior would be to either return an "errno" or
the lle via an additional argument and the other as return value. As
the lle is the return value already I would say adding an extra
argument 'int *error' will be easier.

For now this seems to only affect LLE_DELETE cases but I am not sure
all (especially wrt to the future of v6) has been shaken out yet and
returning a proper error code (possibly along with the NULL lle) would
make this more flexible.
I am also not sure if all the "void" callers on delete are right but
I got distracted by a "dead" function in one of the callpaths while
investigating.

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.

/bz

-- 
Bjoern A. Zeeb                      The greatest risk is not taking one.



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