[Nagiosplug-devel] Flight 1.4.8, ready for boarding

Thomas Guyot-Sionnest dermoth at aei.ca
Tue Apr 3 02:04:03 CEST 2007


On 02/04/07 06:08 PM, sean finney wrote:
> hey guys,
> 
> i guess i ought to chime in on the issue, having written the code in the
> first place :)
> 
> On Mon, 2007-04-02 at 09:17 -0400, Thomas Guyot-Sionnest wrote:
>> Do you have any idea how we should go about the other problem? We could
>> loop on reads until we get the packet type we want, but what about the
>> source port? Do you have any idea how we could make sure we get a new
>> one when we connect the 2nd time?
> 
> it ought to be possible to set up a second udp socket for every host
> without too much trouble.  i believe that unless bind() is called the
> source port is random, so two sockets should mean two different source
> ports implicitly--and udp being what it is the remote server shouldn't
> mind sending one packet to one port and on packet to the other.  this
> should probably prevent the problems with late/re-transmitted ntp time
> packets getting mixed up with the control packets.

There might be another way. According to the article below to disconnect
a UDP socket you have to call connect with the family member of the
socket address structure to AF_UNSPEC. If you don't beat me it time I'll
try to code that and see what happens.

http://kerneltrap.org/node/7491

If someone can tell me what should I use for the 3rd arg of connect()
that'll help, otherwise it won't take me long to figure it out :)

Thomas




More information about the Devel mailing list