On Thu, May 14, 2009 at 03:01:33PM +0000, Michael Shalayeff wrote:
> On Thu, May 14, 2009 at 04:59:26PM +0200, Thierry Deval wrote:
> > Nice trick.
> > Though, wouldn't we break the cmsg loop once the SCM_TIMESTAMP is found ?

oh!
i had that break in my head already! (;
of course.
although we shall not have more timestamps than one (:
zefixt.

> >  +  for (cmsg = CMSG_FIRSTHDR(&somsg); cmsg != NULL;
> >  +      cmsg = CMSG_NXTHDR(&somsg, cmsg)) {
> >  +          if (cmsg->cmsg_level == SOL_SOCKET &&
> >  +              cmsg->cmsg_type == SCM_TIMESTAMP) {
> >  +                  memcpy(&tv1, CMSG_DATA(cmsg), sizeof tv1);
> >  +                  T4 += tv1.tv_sec + JAN_1970 + 1.0e-6 * tv1.tv_usec;
> > ++                  break;
> >  +          }
> >  +  }
> > 
> > Michael Shalayeff wrote:
> > >re
> > >this diff converts ntpd to use socket timestamps (SO_TIMESTAMP sockopt)
> > >for received packets. this seems to reduce deviation by a factor of 5.
> > >code pohnz0red from bgpd and others using recvmsg.
> > >this has ran on a number of servers already (and still should apply
> > >to original ntpd code ;) but surely can use another look.
> > >cu
> > >
> > 
> 
> -- 
>     paranoic mickey       (my employers have changed but, the name has 
> remained)

-- 
    paranoic mickey       (my employers have changed but, the name has remained)

Reply via email to