Subject: Re: Proposal: socketfrom()
To: NetBSD Networking Technical Discussion List <>
From: Greg A. Woods <>
List: tech-net
Date: 07/05/2007 20:25:17
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Thu, 5 Jul 2007 19:06:56 -0400, Thor Lancelot Simon wrote:
Subject: Re: Proposal: socketfrom()
> On Thu, Jul 05, 2007 at 05:54:36PM -0400, Greg A. Woods wrote:
> > At Thu, 5 Jul 2007 14:48:34 -0400, David Maxwell wrote:
> > Subject: Re: Proposal: socketfrom()
> > >=20
> > > It sounded like Thor's application creates new sockets often enough t=
> > > it suffer from not having defaults. So, per-process defaults might wo=
> > > in his case, but it's not hard to imagine a more general solution whe=
> > > an application creates two different types of sockets often - maybe e=
> > > interleaving them - and having to switch the defaults back and forth
> > > every time wouldn't help much.
> >=20
> > I'm having a bit of a hard time imagining such an application....  :-)
> Hint: if I understand it correctly, your proposal would break the
> resolver library.

Hmmm, I suppose it could cause some funny business, assuming the
application set some option for SOCK_DGRAM sockets that wouldn't work so
well for the purposes of resolver(3) and also didn't realize the
potential conflict.

It's still not too hard for me to imagine such an application
temporarily revoking the custom defaults prior to using resolver(3) (or
anything similar, and re-instating them later), or indeed always doing
so during the execution of any thread with the sole purpose of
interacting with such a set of library functions.

I would think though that any application that currently made so many
socket() and setsockopt() calls that some performance enhancement was
needed would have a hard time finding the time to do DNS lookups,
especially within its main loop of execution.  Does your application do
DNS at the same time it's doing all the socket creation and setup?

						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <>
Planix, Inc. <>       Secrets of the Weird <>

Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

Version: PGPfreeware 5.0i for non-commercial use
MessageID: QajSuLsrL9tO/Dsf9AC5+hoEpwBuOerL