ntp: count packets with invalid format

Include packets that cannot be parsed in the total RX count.
This commit is contained in:
Miroslav Lichvar
2019-08-19 13:55:12 +02:00
parent b8ee6d6e56
commit 567e66a0bb
2 changed files with 4 additions and 8 deletions

View File

@@ -1602,8 +1602,6 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr,
stats = SRC_GetSourcestats(inst->source);
inst->report.total_rx_count++;
pkt_leap = NTP_LVM_TO_LEAP(message->lvm);
pkt_version = NTP_LVM_TO_VERSION(message->lvm);
pkt_refid = ntohl(message->reference_id);
@@ -2023,6 +2021,8 @@ NCR_ProcessRxKnown(NCR_Instance inst, NTP_Local_Address *local_addr,
int proc_packet, proc_as_unknown;
NTP_PacketInfo info;
inst->report.total_rx_count++;
if (!parse_packet(message, length, &info))
return 0;