代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/ntp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Subject: [PATCH] process_control() should bail earlier on short packets
---
ntpd/ntp_control.c | 19 +-
1 files changed, 21 insertions(+), 28 deletions(-)
create mode 100644 ntpd/ntp_control.c.orig
diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c
index 48cd908..5984c8c 100644
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -1187,15 +1187,21 @@ process_control(
pkt = (struct ntp_control *)&rbufp->recv_pkt;
/*
- * If the length is less than required for the header, or
- * it is a response or a fragment, ignore this.
+ * If the length is less than required for the header,
+ * ignore it.
*/
- if (rbufp->recv_length < (int)CTL_HEADER_LEN
- || (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
+ if (rbufp->recv_length < (int)CTL_HEADER_LEN) {
+ DPRINTF(1, ("Short control packet\n"));
+ numctltooshort++;
+ return;
+ }
+
+ /*
+ * If this packet is a response or a fragment, ignore it.
+ */
+ if ( (CTL_RESPONSE | CTL_MORE | CTL_ERROR) & pkt->r_m_e_op
|| pkt->offset != 0) {
DPRINTF(1, ("invalid format in control packet\n"));
- if (rbufp->recv_length < (int)CTL_HEADER_LEN)
- numctltooshort++;
if (CTL_RESPONSE & pkt->r_m_e_op)
numctlinputresp++;
if (CTL_MORE & pkt->r_m_e_op)
@@ -1206,6 +1212,7 @@ process_control(
numctlbadoffset++;
return;
}
+
res_version = PKT_VERSION(pkt->li_vn_mode);
if (res_version > NTP_VERSION || res_version < NTP_OLDVERSION) {
DPRINTF(1, ("unknown version %d in control packet\n",
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。