[Resolved] ntp client /time setting BS latest firmware

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Author Message
sesshomaru86
DD-WRT Novice


Joined: 03 May 2017
Posts: 17
Location: Wien

PostPosted: Sun Feb 11, 2018 0:21    Post subject: [Resolved] ntp client /time setting BS latest firmware Reply with quote
Hello all! I just installed the latest firmware of the dear Brainslayer DD-WRT v3.0-r34876 std (02/08/1Cool but cant get my router (linksys wrt1200 v1) to save the date. I tried leave the ntp server name blank - nothing happened . The time is stuck on 1 january 1970 . I tried change the ntp server , put the server in ip form but nothing. The thing is im running a vpn and if the time isnt correct i got the tls error. For now i got to change it manually typing on the command date YYMMDDHHMM but after every restart the date is reseted again ! Some tip or solution ? Thanx !


p.s. just saw there is a bug report from another guy on http://svn.dd-wrt.com/ticket/6137 by RangoStar

Exactly my problem too. Tried the 02-10-2018-r34886 new version that came out today. Problem persists.


Last edited by sesshomaru86 on Sun Feb 18, 2018 11:41; edited 1 time in total
Sponsor
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Thu Feb 15, 2018 16:29    Post subject: Re: ntp client /time setting BS latest firmware Reply with quote
sesshomaru86 wrote:
p.s. just saw there is a bug report from another guy on http://svn.dd-wrt.com/ticket/6137 by RangoStar

Exactly my problem too. Tried the 02-10-2018-r34886 new version that came out today. Problem persists.

34929 is out! For Broadcom, this thread:
https://www.dd-wrt.com/forum/viewtopic.php?t=313838

I think Kong released a new build as well!

BTW, read this thread which includes a startup script solution I wrote to get time without using NTP:
https://www.dd-wrt.com/forum/viewtopic.php?t=313747&start=2

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
sesshomaru86
DD-WRT Novice


Joined: 03 May 2017
Posts: 17
Location: Wien

PostPosted: Sun Feb 18, 2018 11:41    Post subject: Re: ntp client /time setting BS latest firmware Reply with quote
mwchang wrote:
sesshomaru86 wrote:
p.s. just saw there is a bug report from another guy on http://svn.dd-wrt.com/ticket/6137 by RangoStar

Exactly my problem too. Tried the 02-10-2018-r34886 new version that came out today. Problem persists.

34929 is out! For Broadcom, this thread:
https://www.dd-wrt.com/forum/viewtopic.php?t=313838

I think Kong released a new build as well!

BTW, read this thread which includes a startup script solution I wrote to get time without using NTP:
https://www.dd-wrt.com/forum/viewtopic.php?t=313747&start=2


I flashed the r34929 and now magically everything works!

Awesome script mwchang ! I will have it in mind for the next time ! Thanx !
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1410

PostPosted: Sun Feb 18, 2018 15:35    Post subject: Reply with quote
Here is my analysis of the code and what is going on:

Quote:
I have spent some time looking at the mini-ntpclient.c code

I think that where the ntp problem occurring is

using rev 34895 line numbers


What is happening is that on line 87 when getaddrinfo is called result is a linked list of IPV4 and/or IPV6 addresses since on line 78 the ai_family was set to AF_UNSPEC (so the code does not care which ip version).

When line 96 is reached it is a for loop (because I am assuming the intent was to read through the list). When the "if" statements are reached (depending on if the ai_family is AF_INET or AF_INET6) there is a "break" that exits the loop. This means that only the first entry in the list is evaluated and copied. If this happens to be an AF_INET6 (as you know is IPV6) then that is what is used even if the user has ipv6 disabled. The DNS lookup does not care if it is IPv4 or IPv6 (for example do a nslookup on say google it returns IPv4 and IPv6 addresses).

Those of us that happen to select a server that can be resolved by either IPv4 or IPv6 seem to be drawing the IPv6 address as the first in the list. Obviously, if one is on IPv4, the IPv6 address will not work and the system logs an error and keeps repeating this bug.

There are multiple ways to fix this and since you guys maintain the code, I would rather you choose the method. If you need ideas though ask, I will suggest.

Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum