Subject: Re: RFC [patch]: unify route cache
To: None <tech-net@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-net
Date: 04/25/2007 07:52:37
On Tue, Apr 24, 2007 at 10:52:26PM -0500, David Young wrote:
> struct sockaddr *sockaddr_alloc(sa_family_t af, int flags);
> struct sockaddr *sockaddr_copy(struct sockaddr *dst,
> const struct sockaddr *src);
> struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags);
> struct sockaddr *sockaddr_free(struct sockaddr *sa);
As we force maximum size allocations for the sockaddr, sockaddr_copy can
return void? I don't think the return value makes real sense for that.
sockaddr_free is actually returning void already.
> 3 structs route_in6 and route_iso are no more. All protocol families use
> struct route. I have changed the route cache, 'struct route', so
> that it does not contain storage space for a sockaddr. Instead,
> struct route points to a sockaddr coming from the pool the sockaddr
> belongs to. I added a new method to struct route, rtcache_setdst(),
> for setting the cache destination:
Long term I'd prefer if we can get the pools waitok-safe, but that's
outside the scope.
Thanks, David.
Joerg