Otto Moerbeek:

> Currently testing this.

For "port unreachable" replies, this caused ntpd to become unsynced, but
the peer still remains valid.

--------------------
1/1 peers valid, clock unsynced

peer
   wt tl st  next  poll          offset       delay      jitter
fddd:28ee:243:2:213:95ff:fe06:1bb7 ntp
    1 10  1 1212s 3199s        -0.409ms     1.027ms     0.388ms
--------------------

> Index: client.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ntpd/client.c,v
> retrieving revision 1.113
> diff -u -p -r1.113 client.c
> --- client.c  30 Jan 2020 15:55:41 -0000      1.113
> +++ client.c  1 Sep 2020 19:15:22 -0000
> @@ -456,7 +456,7 @@ client_dispatch(struct ntp_peer *p, u_in
>       if (++p->shift >= OFFSET_ARRAY_SIZE)
>               p->shift = 0;
>  
> -     return (0);
> +     return (1);
>  }
>  
>  int
> Index: ntp.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ntpd/ntp.c,v
> retrieving revision 1.166
> diff -u -p -r1.166 ntp.c
> --- ntp.c     30 Aug 2020 16:21:29 -0000      1.166
> +++ ntp.c     1 Sep 2020 19:15:22 -0000
> @@ -403,12 +403,9 @@ ntp_main(struct ntpd_conf *nconf, struct
>               for (; nfds > 0 && j < idx_clients; j++) {
>                       if (pfd[j].revents & (POLLIN|POLLERR)) {
>                               nfds--;
> -                             last_action = now;
>                               if (client_dispatch(idx2peer[j - idx_peers],
> -                                 conf->settime, conf->automatic) == -1) {
> -                                     log_warn("pipe write error (settime)");
> -                                     ntp_quit = 1;
> -                             }
> +                                 conf->settime, conf->automatic) == 1)
> +                                     last_action = now;
>                       }
>               }
>  

-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to