[Nagiosplug-devel] Flight 1.4.8, ready for boarding
Thomas Guyot-Sionnest
dermoth at aei.ca
Tue Apr 3 04:23:33 CEST 2007
On 02/04/07 08:04 PM, Thomas Guyot-Sionnest wrote:
> 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 :)
Using AF_UNSPEC didn't work, so my fix was simply not to close the
sockets. While this works, I left a note in the code explaining why and
looking for a better way. Should I open a new, low priority bug for
that? The proper way to verify that new code fix the problem it to:
1. Uncomment the line where it closes the sockets.
2. Confirm using packet captures that both NTP and NTP Control messages
use the same local port. If they don't, find a system where they do
(Ubuntu 6.10 do)
3. Fix it.
4. Confirm on the same system as (2) that the NTP and NTP Control
messages use different local ports.
Please also note that I still can't get the jitter on my sun box
(solaris.beaubien.net). According to Holger this could be due to the
byte order, though running check_ntp on that sun box still give me the
same results (is that expected?).
One last note, I get different results on my sun box than on my home
computer (Ububtu). I'll investigate this a little bit...
Thomas
More information about the Devel
mailing list