From: Juergen Perlinger Date: Sat, 7 Dec 2019 07:19:05 +0000 (+0100) Subject: [bug 3592] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=043d5b1b93ad33e4ffb807d530ec1dad7c5a85d6;p=thirdparty%2Fntp.git [bug 3592] first try to move poll_update bk: 5deb5269ieF1tee6Mp3UJyZOk8DB-Q --- diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index b821c6c54..c4272b8ca 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -700,7 +700,7 @@ receive( sys_badlength++; return; /* bogus length */ } - + hisleap = PKT_LEAP(pkt->li_vn_mode); hisstratum = PKT_TO_STRATUM(pkt->stratum); INSIST(0 != hisstratum); /* paranoia check PKT_TO_STRATUM result */ @@ -2401,9 +2401,17 @@ receive( /* * The dance is complete and the flash bits have been lit. Toss * the packet over the fence for processing, which may light up - * more flashers. + * more flashers. Leave if the packet is not good. */ process_packet(peer, pkt, rbufp->recv_length); + if (peer->flash & PKT_TEST_MASK) + return; + + /* [bug 3592] Update poll. Ideally this should not happen in a + * receive branch, but too much is going on here... at least we + * do it only if the packet was good! + */ + poll_update(peer, peer->hpoll); /* * In interleaved mode update the state variables. Also adjust the @@ -2483,8 +2491,6 @@ process_packet( peer->seldisptoolarge++; DPRINTF(1, ("packet: flash header %04x\n", peer->flash)); - /* See bug 3592. */ - poll_update(peer, peer->hpoll); /* ppoll updated? */ return; } @@ -2528,11 +2534,6 @@ process_packet( if (peer->burst > 0) peer->nextdate = current_time; } - /* - * While looking at bug 3592, Pearly wonders if the - * poll_update() below should be inside the "if" block above - */ - poll_update(peer, peer->hpoll); /**/