[Git][NTPsec/ntpsec][master] Removed unnecessary packet parsing from ntp_monitor().
Ian Bruene
gitlab at mg.gitlab.com
Fri Apr 27 17:56:17 UTC 2018
Ian Bruene pushed to branch master at NTPsec / ntpsec
Commits:
a18095ff by Ian Bruene at 2018-04-27T17:55:04Z
Removed unnecessary packet parsing from ntp_monitor().
- - - - -
1 changed file:
- ntpd/ntp_monitor.c
Changes:
=====================================
ntpd/ntp_monitor.c
=====================================
--- a/ntpd/ntp_monitor.c
+++ b/ntpd/ntp_monitor.c
@@ -323,8 +323,6 @@ ntp_monitor(
)
{
l_fp interval_fp;
- struct pkt * pkt;
- struct pkt pkt_core;
mon_entry * mon;
mon_entry * oldest;
int oldest_age;
@@ -332,6 +330,7 @@ ntp_monitor(
unsigned short restrict_mask;
uint8_t mode;
uint8_t version;
+ uint8_t li_vn_mode;
int interval;
int head; /* headway increment */
int leak; /* new headway */
@@ -340,12 +339,10 @@ ntp_monitor(
if (mon_enabled == MON_OFF)
return ~(RES_LIMITED | RES_KOD) & flags;
- unmarshall_pkt(&pkt_core, rbufp);
- pkt = &pkt_core;
-
hash = MON_HASH(&rbufp->recv_srcadr);
- mode = PKT_MODE(pkt->li_vn_mode);
- version = PKT_VERSION(pkt->li_vn_mode);
+ li_vn_mode = rbufp->recv_buffer[0];
+ mode = PKT_MODE(li_vn_mode);
+ version = PKT_VERSION(li_vn_mode);
mon = mon_hash[hash];
/*
* We keep track of all traffic for a given IP in one entry,
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a18095ffd63dfa88568f0ff2640bd709d1b68091
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a18095ffd63dfa88568f0ff2640bd709d1b68091
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20180427/8f289a69/attachment.html>
More information about the vc
mailing list