[Twisted-Python] mktap dns is broken if you switch subnets

Jp Calderone exarkun at intarweb.us
Wed Apr 30 14:43:57 EDT 2003

On Wed, Apr 30, 2003 at 07:01:59PM +0300, Tommi Virtanen wrote:
> 	Hi. Lately, I've been playing with using "mktap dns" as a
> 	resolver for my laptop. Except, it's making me angry.
> 	It doesn't reload resolv.conf. My resolv.conf nameserver list
> 	is changed by DHCP about twice per day, atleast.

  The "usability" of t.names could be a bit better, I agree.

> 	In fact, it even loads the resolv.conf only in __init__, so
> 	the list gets stored in the tap file. I need to mktap, tap2deb
> 	and dpkg -i whenever I switch subnets!
> 	Here's a quick-and-stupid patch that makes it reload
> 	resolv.conf regularly, currently made to reread it every
> 	minute. This is "close enough". Actually, I want to make
> 	it get a notification from somewhere..

  It would be great if Twisted could speak FAM.  I looked briefly at
integrating the python wrapper, but didn't have time to go very in-depth. 

> 	I definitely want this implemented. Please tell what direction
> 	should I go with the patch, and what do you think is missing
> 	from "production quality"?

  It basically looks good.  One thing I'd like done differently is to have
parseConfig() called at a different time.  Possibly calling it as a result
of connectionMade() further increases an already large latency on queries. 
If this were done in a callLater() loop, this would keep the parsing
overhead out of the path of actual queries the client performs.

  As a short term solution, I think this is reasonable (but the point is
moot if we wrap and use libfam).  How's it sound to you?

> [snip patch]


A disciple of another sect once came to Drescher as he was eating his
morning meal. "I would like to give you this personality test," said the
outsider, "because I want you to be happy." Drescher took the paper that was
offered him and put it into the toaster: "I wish the toaster to be happy, 
 up 41 days, 15:04, 4 users, load average: 0.00, 0.00, 0.00
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030430/dd05da67/attachment.pgp 

More information about the Twisted-Python mailing list