Subject: Re: Proposal: socketfrom()
To: NetBSD Networking Technical Discussion List <tech-net@NetBSD.org>
From: Greg A. Woods <woods@planix.com>
List: tech-net
Date: 07/05/2007 20:25:17
--pgp-sign-Multipart_Thu_Jul__5_20:25:17_2007-1
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()
>=20
> 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=
hat
> > > it suffer from not having defaults. So, per-process defaults might wo=
rk
> > > in his case, but it's not hard to imagine a more general solution whe=
re
> > > an application creates two different types of sockets often - maybe e=
ven
> > > 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....  :-)
>=20
> 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?

--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

--pgp-sign-Multipart_Thu_Jul__5_20:25:17_2007-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

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

iQA/AwUBRo2L7WZ9cbd4v/R/EQJ42ACgpJe1MVkpvpnymig1ne32nLSMCVMAnjk0
B3MxD24+1ksOadLPORvihYhu
=gOGb
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Thu_Jul__5_20:25:17_2007-1--