[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: To the bind maintainer



On Thu, Jan 27, 2000 at 03:19:49PM -0500, james@netcsi.com wrote:
> On Wed, Jan 26, 2000 at 09:08:49AM -0500, Elie Rosenblum wrote:
> > No.
> > 
> > If you bind to the 'default interface' it means you're just saying
> > 'Bind this port for me. I don't care what interface traffic comes in
> > on'. It will accept it off any interface, even ones created after the
> > bind is done. The program doesn't need to do anything to support this.
> 
> IIRC this isn't true, and it will only accept packets from interfaces that
> existed at the time of the bind(2) call.
> 
> I recall running into this problem when making a perl script to repeatedly
> query a dns server until a response comes back, thus convincing diald to
> establish a connection.  diald is supposed to do this automatically thanks
> to the program's own dns queries, but glibc's dns backoff behavior and
> diald's timeouts and redial delays could easily interact in undesirable
> ways making such a script necessary for reliable network-using cron scripts.
> 
> Anyway, i bound with 'default interface' and the script would just query and
> query, never noticing when ppp actually came up and the responses started
> coming in (and i could see them arrive with tcpdump or modem lights).  so i
> ended up having to rebind automatically each 5 seconds when another packet
> was sent :( and then it worked.

This sounds like a DNS issue; if you're listening on INADDR_ANY, it
should not matter when you started listening - last I looked, the
kernel doesn't emulate INADDR_ANY with a seperate entry for each
current address, it puts in a single INADDR_ANY record.

If you mean binding a socket from which you are _sending_, it will
pick up an interface address when a packet is dispatched outward.
That may be causing what you were seeing, but I don't really have
time for a code review. :)

-- 
Elie Rosenblum                 That is not dead which can eternal lie,
http://www.cosanostra.net   And with strange aeons even death may die.
Admin / Mercenary / System Programmer             - _The Necronomicon_


Reply to: