[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwknop-discuss
Subject:    Re: [Fwknop-discuss] fwknopd time bug
From:       "Steve Mckinney (stmckinn)" <stmckinn () cisco ! com>
Date:       2008-09-25 11:49:13
Message-ID: BEFEEFB82ACFBC40A19EADBB51A23D4C0CD632 () xmb-rtp-218 ! amer ! cisco ! com
[Download RAW message or body]


I see the reason for it now.  I didn't consider machines in different
time zones.

Thanks,
Steve

-----Original Message-----
From: Michael Rash [mailto:mbr@cipherdyne.org] 
Sent: Thursday, September 25, 2008 1:07 AM
To: fwknop-discuss@lists.sourceforge.net
Subject: Re: [Fwknop-discuss] fwknopd time bug

On Sep 24, 2008, Steve Mckinney (stmckinn) wrote:

Hi Steve -

> I found a bug in the check for old remote time stamps.  I found it by 
> modifying fwknopd to show the "local" time and the remote time when it

> throws a "remote time stamp" message.  The results are below:
> 
> 
> Wed Sep 24 11:09:18 2008 [-] remote time stamp is older than 120 
> second max age. local: 1222268958, remote: 1222272559, diff: 3601
> 
> 
> You can see that the timestamp of the log message is around 11:09am, 
> the "local" timestamp given by perl's time() function is around 
> 10:09am, and that of the remote system is around 11:09am.
> 
> The time() function shouldn't be used here because local time is
needed.
> localtime() gives the intended result, it just needs to be converted 
> to a Unix timestamp.

fwknop needs a universal time stamp that is the same across time zones,
and time() returns the seconds since the epoch time (although this is
not standard across all systems according to the description of
time() in the perlfunc man page).

I have access to two systems in different time zones, but time() results
in values that are the same since they report the same number of seconds
since epoch time.  These two system are synchronized with ntp, and I've
executed the commands below one second apart:

[sys1]$ date && perl -e 'print time(), "\n"'
Wed Sep 24 21:35:15 PDT 2008
1222317315

[sys2]$ date && perl -e 'print time(), "\n"'
Thu Sep 25 00:35:16 EDT 2008
1222317316

$ bc
1222317316 - 1222317315
1

Given the above, I'm not sure I understand the need for using
localtime()?

The difference in your output above is 3601 seconds, which seems to
indicate that there is a time zone issue as you point out - and I
believe that Sean's updated UI has fixed this.

Thanks,

--Mike


> 
> Steve

> ----------------------------------------------------------------------
> --- This SF.Net email is sponsored by the Moblin Your Move Developer's

> challenge Build the coolest Linux based applications with Moblin SDK &

> win great prizes Grand prize is a trip for two to an Open Source event

> anywhere in the world 
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Fwknop-discuss mailing list
> Fwknop-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fwknop-discuss


------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge Build the coolest Linux based applications with Moblin SDK &
win great prizes Grand prize is a trip for two to an Open Source event
anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fwknop-discuss mailing list
Fwknop-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fwknop-discuss

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fwknop-discuss mailing list
Fwknop-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fwknop-discuss
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic