[ntp:questions] NTP 4.2.5p180 adds IPv6 support on Windows

Danny Mayer mayer at ntp.org
Mon Jun 1 12:10:39 UTC 2009

Dave Hart wrote:
> On Sun, May 31, 2009 at 1:10 AM, Danny Mayer <mayer at ntp.org> wrote:
>> David J Taylor wrote:
>>> 30/05/2009 06:37:45 NTP Error None 1 N/A BACCHUS setsockopt(208,
>>> SO_EXCLUSIVEADDRUSE, on): Invalid argument
>> I remember seeing that too on my Windows 2000 server as well but I
>> didn't get around to looking at it before. That's because Dave created
>> an ifdef around the function call. However it's always defined for
>> Windows because he defined it in config.h. What is really needed here is
>> a run-time check for Windows version to see if it can be set. However
>> this was first made available in NT 4.0 SP4 so it should be supported
>> and I don't see why it would fail in this way. I think that the real
>> reason for this problem is that it is not available to anyone but
>> admistrators before XP.
> I think Danny put his finger on it with the administrators group.  I
> had forgotten that ugly little wrinkle.  I suspect the messages would
> go away if David Taylor put his "ntp" user in the Administrators group
> temporarily:
> net localgroup administrators ntp /add
> and to return to normal:
> net localgroup administrators ntp /del
> I'm not sure a runtime check is useful, though, except to decide at
> runtime to not log this particular error code on systems earlier than
> XP.   Attempting to set it still seems like the right thing to me.

I didn't see the error message this morning when I tried it on my 2000
server. However, you should not ifndef out the code in set_reuseaddr().
The code should do both if available. It does affect wildcard use and it
fails to bind other addresses once the wildcard address is bound. I
notice that you do a version check in open_socket for versions before XP
but fail to allow it to use the set_reuseaddr() since
SO_EXCLUSIVEADDRUSE is defined by the compiler. There is no reason for
the version check for SO_REUSEADDR but there is for the
SO_EXCLUSIVEADDRUSE and that can be done withing the function.



This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the questions mailing list