Skip to content

Commit

Permalink
only respond to clients
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Jun 6, 2024
1 parent 97cd1ab commit 02cc2e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ntp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ void ntp::input(const any_addr & src_ip, int src_port, const any_addr & dst_ip,

sntp_datagram *sntp = reinterpret_cast<sntp_datagram *>(p->get_data());

if (sntp->mode == 1 || sntp->mode == 3) { // time request
if (sntp->mode == 3) { // time request
stats_inc_counter(ntp_time_req);

stats_inc_counter(ntp_t_req_v[sntp->vn]);

sntp_datagram msgout { 0 };

msgout.li = 0;
msgout.mode = sntp->mode == 1 ? 1 : 4; // 4: server
msgout.mode = 4; // 4: server
msgout.vn = 3;
msgout.precision = -18; // 3.8us
msgout.stratum = 2;
Expand Down

0 comments on commit 02cc2e8

Please sign in to comment.